Fix broken RSA

This commit is contained in:
2025-07-31 18:47:06 -07:00
parent e555fddfb4
commit 1904ccb37c
+3 -4
View File
@@ -93,10 +93,9 @@ using (HttpClient client = new HttpClient()) {
HttpResponseMessage PublicKeyResponse = await client.GetAsync("https://auth.mistox.com/api/auth/publickey"); HttpResponseMessage PublicKeyResponse = await client.GetAsync("https://auth.mistox.com/api/auth/publickey");
if (PublicKeyResponse.IsSuccessStatusCode) { if (PublicKeyResponse.IsSuccessStatusCode) {
string publicKey = await PublicKeyResponse.Content.ReadAsStringAsync(); string publicKey = await PublicKeyResponse.Content.ReadAsStringAsync();
using (RSA rsa = RSA.Create()) { RSA rsa = RSA.Create();
rsa.ImportFromPem(publicKey); rsa.ImportFromPem(publicKey);
PublicKey = new RsaSecurityKey(rsa); PublicKey = new RsaSecurityKey(rsa);
}
} else { } else {
await Task.Delay(2000); // sleep the main thread for 2 seconds before sending another request. Prevent DDOS of my own equiptment await Task.Delay(2000); // sleep the main thread for 2 seconds before sending another request. Prevent DDOS of my own equiptment
} }