I was able to get this working with SNI. I followed this article. https://docs.microsoft.com/en-us/iis/get-started/whats-new-in-iis-8/iis-80-server-name-indication-sni-ssl-scalability
I extracted PSU 1.3.1 to the C:\inetpub\magic and C:\inetpub\pokemon folders. I set “Everyone” permissions to make sure that wasn’t the issue and ran dir -Recurse | Unblock-File
on the folder.
In IIS, I have 2 certs configured. I created them in IIS with the self-signed cert tool.
I created 2 app pools. One for each website. I set the app pool identity as administrator because I was having some permission problems but those were evident in the event log so if you’re not seeing that, I doubt that’s your issue.
When I setup the websites, I configured SNI and set the certs accordingly. Both websites were setup to listen on 443.
Both the appsettings.json
files are the same.
{
"Kestrel": {
"Endpoints": {
"HTTP": {
"Url": "http://*:5000"
}
}
},
"ApplicationInsights": {
"InstrumentationKey": ""
},
"Logging": {
"Path":"./logs/log.txt",
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"Data": {
"RepositoryPath": ".\\Repository",
"ConnectionString": ".\\database.db",
"GitRemote": "",
"GitUserName": "",
"GitPassword": ""
},
"Api": {
"Url": ""
},
"Authentication" : {
"Windows": {
"Enabled": "false"
},
"WSFed": {
"Enabled": "false",
"MetadataAddress": "",
"Wtrealm": "",
"CallbackPath": "/auth/signin-wsfed"
},
"OIDC": {
"Enabled": "false",
"CallbackPath": "/auth/signin-oidc",
"ClientID": "",
"ClientSecret": "",
"Resource": "",
"Authority": "",
"ResponseType": "",
"SaveTokens": "false"
},
"SessionTimeout": "25"
},
"Jwt": {
"SigningKey": "PleaseUseYourOwnSigningKeyHere",
"Issuer": "IronmanSoftware",
"Audience": "PowerShellUniversal"
},
"UniversalDashboard": {
"AssetsFolder": ".\\Dashboard"
}
}
Both sites are running and sharing a port.
In order to access the sites, I need to switch the host file according to the doc: https://docs.microsoft.com/en-us/iis/get-started/whats-new-in-iis-8/iis-80-server-name-indication-sni-ssl-scalability#test-a-secure-site
If I switch my host file to:
127.0.0.1 magic
I can access the magic site on HTTPS.
If I switch my host file to:
127.0.0.1 pokemon
I can access the pokemon site on HTTPS.
I’m assuming that in a production environment, the host file step isn’t needed as the host name should correctly resolve in DNS based on the domain you are in.