Management Hub SSL Configuration

I have created the SSL cert copied it to the correct folder and modified the hubservice.json file as documented. When I restart the service the service will not start. I get the following error in the event viewer.

Event ID 1026

Application: Certify.Server.HubService.exe
CoreCLR Version: 10.0.1226.42308
.NET Version: 10.0.12
Description: The process was terminated due to an unhandled exception.
Exception Info: System.InvalidOperationException: Token authentication requires JwtSettings:secret to be set. This is normally generated automatically into hubservice.json in the service app data path (e.g. C:\ProgramData\certify\hubservice.json), so this usually means that file could not be read or written. Check the service has write access to it, or set JwtSettings:secret manually to a fresh 32 byte random value, base64 encoded.
at Certify.Server.Hub.Api.Middleware.AuthenticationExtension.AddTokenAuthentication(IServiceCollection services, IConfiguration config) in D:\a\certify-internal\certify-internal\src\certify-build\certify\src\Certify.Server\Certify.Server.Hub.Api\Middleware\AuthenticationExtension.cs:line 67
at Program.$(String args) in D:\a\certify-internal\certify-internal\src\certify-build\certify\src\Certify.Server\Certify.Server.HubService\Program.cs:line 236
at Program.(String args)

Contents of hubservice.json file:

{
“Logging”: {
“LogLevel”: {
“Default”: “Information”,
“Microsoft”: “Warning”,
“Microsoft.Hosting.Lifetime”: “Information”
}
},
“JwtSettings”: {
“secret”: “YcURAJlNyEV/cNR1YWlzsn3QG+8u72RdE1USvajexgg=”,
“refreshTokenExpirationInMinutes”: 1440,
“authTokenExpirationInMinutes”: 60,
“issuer”: “Certify.Server.Hub.Api”
},
// Sign in options for the hub API.
// Set “enablePasswordLogin” to false to accept OpenID Connect sign in only, so that built in username/password
// credentials cannot be used to bypass the identity provider. Configure at least one OIDC provider before doing
// this, otherwise there is no way to sign in until the setting is put back.
“AuthSettings”: {
“enablePasswordLogin”: true
},
“Kestrel”: {
“Endpoints”: {
“SvcHttpEndpoint”: {
“Url”: “http://0.0.0.0:8080”
}

  // Example HTTPS config. Remove /* and */ to use, keep the comma before the entry so that the json remains valid. Before using, acquire a certificate for desired host e.g. certifyhub.intranet.yourdomain.com
  // Then add a Deployment Task (Export Certificate) to export pfx to where it's required e.g. C:\ProgramData\certify\internal-certs\hub.pfx, then run the task to export the initial certificate.
  // the choice of port and filename etc is arbitrary, as long as the process can access the file.
  // https://learn.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel/endpoints?view=aspnetcore-9.0
  /
    ,
    "HttpsInlineCertFile": {
            "Url": "https://0.0.0.0:9697",
            "Certificate": {
              "Path": "C:\\ProgramData\\certify\\internal-certs\\hub.pfx",
              "Password": ""
            }
          }
    /
}

}
}

This is fixed. there were a couple extra / in the file that were causing a problem.

1 Like