From 8da54b0c3076a5ad57a58f4c94bb466d3c0f7b76 Mon Sep 17 00:00:00 2001 From: SlejmUr Date: Wed, 20 Sep 2023 20:15:47 +0200 Subject: [PATCH] Cert fix --- Cert/run.bat | 4 ++-- PayCheckServerLib/Responses/IAM.cs | 2 +- PayCheckServerLib/Servers/PC3Server.cs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cert/run.bat b/Cert/run.bat index 70ef9ef..6a62c60 100644 --- a/Cert/run.bat +++ b/Cert/run.bat @@ -1,5 +1,5 @@ openssl genpkey -outform PEM -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out cert.key -openssl req -new -nodes -key cert.key -config cert.conf -nameopt utf8 -utf8 -out global.csr -openssl req -x509 -nodes -in cert.csr -days 365 -key global.key -config cert.conf -extensions req_ext -nameopt utf8 -utf8 -out cert.crt +openssl req -new -nodes -key cert.key -config cert.conf -nameopt utf8 -utf8 -out cert.csr +openssl req -x509 -nodes -in cert.csr -days 365 -key cert.key -config cert.conf -extensions req_ext -nameopt utf8 -utf8 -out cert.crt certutil -p "cert,cert" -mergepfx cert.crt cert.pfx pause \ No newline at end of file diff --git a/PayCheckServerLib/Responses/IAM.cs b/PayCheckServerLib/Responses/IAM.cs index ac6dca8..c8d817a 100644 --- a/PayCheckServerLib/Responses/IAM.cs +++ b/PayCheckServerLib/Responses/IAM.cs @@ -174,7 +174,7 @@ public static bool LiveToken(HttpRequest request, PC3Server.PC3Session session) }, Permissions = new() { }, PlatformId = "live", - PlatformUserId = "", + PlatformUserId = "", //todo, how the fuck you got the userid from jwt RefreshExpiresIn = 86400, RefreshToken = refresh_token.ToBase64(), Roles = new() { "2251438839e948d783ec0e5281daf05" }, diff --git a/PayCheckServerLib/Servers/PC3Server.cs b/PayCheckServerLib/Servers/PC3Server.cs index df9354c..a9b4f1d 100644 --- a/PayCheckServerLib/Servers/PC3Server.cs +++ b/PayCheckServerLib/Servers/PC3Server.cs @@ -14,8 +14,8 @@ public class PC3Server { public static X509Certificate GetCert() { - - X509Certificate2 cert = new(File.ReadAllBytes($"cert.pfx")); + //read the cert.pfx + X509Certificate2 cert = new(File.ReadAllBytes($"cert.pfx"), "cert"); return cert; }