mirror of
https://github.com/MAKS-IT-COM/maksit-certs-ui.git
synced 2025-12-31 04:00:03 +01:00
(bugfix): existing cert JswService missing initialization
This commit is contained in:
parent
4359d317c0
commit
2b89c7e41d
@ -49,27 +49,6 @@
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "terms of service",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [],
|
||||
"url": {
|
||||
"raw": "http://localhost:8080/CertsFlow/TermsOfService/{{sessionId}}",
|
||||
"protocol": "http",
|
||||
"host": [
|
||||
"localhost"
|
||||
],
|
||||
"port": "8080",
|
||||
"path": [
|
||||
"CertsFlow",
|
||||
"TermsOfService",
|
||||
"{{sessionId}}"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "configure client",
|
||||
"event": [
|
||||
@ -130,6 +109,27 @@
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "terms of service",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [],
|
||||
"url": {
|
||||
"raw": "http://localhost:8080/CertsFlow/TermsOfService/{{sessionId}}",
|
||||
"protocol": "http",
|
||||
"host": [
|
||||
"localhost"
|
||||
],
|
||||
"port": "8080",
|
||||
"path": [
|
||||
"CertsFlow",
|
||||
"TermsOfService",
|
||||
"{{sessionId}}"
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": []
|
||||
},
|
||||
{
|
||||
"name": "init",
|
||||
"event": [
|
||||
@ -276,7 +276,7 @@
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\r\n \"hostnames\": [\r\n \"maks-it.com\"\r\n ],\r\n \"challengeType\": \"http-01\"\r\n}",
|
||||
"raw": "{\r\n \"hostnames\": [\r\n \"staging.maks-it.com\"\r\n ],\r\n \"challengeType\": \"http-01\"\r\n}",
|
||||
"options": {
|
||||
"raw": {
|
||||
"language": "json"
|
||||
@ -326,9 +326,10 @@
|
||||
"method": "GET",
|
||||
"header": [],
|
||||
"url": {
|
||||
"raw": "http://maks-it.com/.well-known/acme-challenge/{{challenge}}",
|
||||
"raw": "http://staging.maks-it.com/.well-known/acme-challenge/{{challenge}}",
|
||||
"protocol": "http",
|
||||
"host": [
|
||||
"staging",
|
||||
"maks-it",
|
||||
"com"
|
||||
],
|
||||
@ -396,7 +397,7 @@
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\r\n \"hostnames\": [\r\n \"maks-it.com\"\r\n ]\r\n}",
|
||||
"raw": "{\r\n \"hostnames\": [\r\n \"staging.maks-it.com\"\r\n ]\r\n}",
|
||||
"options": {
|
||||
"raw": {
|
||||
"language": "json"
|
||||
@ -435,7 +436,7 @@
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\r\n \"hostnames\": [\r\n \"maks-it.com\"\r\n ]\r\n}",
|
||||
"raw": "{\r\n \"hostnames\": [\r\n \"staging.maks-it.com\"\r\n ]\r\n}",
|
||||
"options": {
|
||||
"raw": {
|
||||
"language": "json"
|
||||
@ -474,7 +475,7 @@
|
||||
],
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\r\n \"hostnames\": [\r\n \"maks-it.com\"\r\n ]\r\n}",
|
||||
"raw": "{\r\n \"hostnames\": [\r\n \"staging.maks-it.com\"\r\n ]\r\n}",
|
||||
"options": {
|
||||
"raw": {
|
||||
"language": "json"
|
||||
|
||||
@ -12,6 +12,7 @@ using MaksIT.LetsEncrypt.Models.Requests;
|
||||
using MaksIT.LetsEncrypt.Entities.Jws;
|
||||
using DomainResults.Common;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Security.Principal;
|
||||
|
||||
namespace MaksIT.LetsEncrypt.Services;
|
||||
|
||||
@ -100,10 +101,13 @@ public class LetsEncryptService : ILetsEncryptService {
|
||||
if (cache != null && cache.AccountKey != null) {
|
||||
state.Cache = cache;
|
||||
accountKey.ImportCspBlob(cache.AccountKey);
|
||||
|
||||
state.JwsService = new JwsService(accountKey);
|
||||
state.JwsService.SetKeyId(cache.Location.ToString());
|
||||
}
|
||||
else {
|
||||
// New Account request
|
||||
state.JwsService = new JwsService(accountKey);
|
||||
|
||||
|
||||
var letsEncryptOrder = new Account {
|
||||
TermsOfServiceAgreed = true,
|
||||
@ -111,6 +115,10 @@ public class LetsEncryptService : ILetsEncryptService {
|
||||
};
|
||||
|
||||
var (account, postAccountResult) = await SendAsync<Account>(sessionId, HttpMethod.Post, state.Directory.NewAccount, false, letsEncryptOrder);
|
||||
if (!postAccountResult.IsSuccess || account?.Result?.Location == null)
|
||||
return postAccountResult;
|
||||
|
||||
state.JwsService = new JwsService(accountKey);
|
||||
state.JwsService.SetKeyId(account.Result.Location.ToString());
|
||||
|
||||
if (account.Result.Status != "valid") {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user