[GH-ISSUE #148] IIS complains about missing intermediates #89

Open
opened 2026-02-25 22:32:34 +03:00 by kerem · 19 comments
Owner

Originally created by @natiki on GitHub (Mar 13, 2019).
Original GitHub issue: https://github.com/FiloSottile/mkcert/issues/148

Hi,

  • Windows 10 1809 Professional
  • IIS 10.0.17763.1
  • Have run mkcert -install

Generated my new wildcard certificate as:

 mkcert -pkcs12 "*.ozc.black"

I then go to IIS > Server Certificates and try and import it but am prompted for a password?

image

What am I missing here? It is not my login password.

Originally created by @natiki on GitHub (Mar 13, 2019). Original GitHub issue: https://github.com/FiloSottile/mkcert/issues/148 Hi, - Windows 10 1809 Professional - IIS 10.0.17763.1 - Have run mkcert -install Generated my new wildcard certificate as: ``` mkcert -pkcs12 "*.ozc.black" ``` I then go to IIS > Server Certificates and try and import it but am prompted for a password? ![image](https://user-images.githubusercontent.com/4738140/54255278-85eaea00-45ab-11e9-944f-55b2f0108114.png) What am I missing here? It is not my login password.
Author
Owner

@FiloSottile commented on GitHub (Mar 13, 2019):

The password is “changeit” (for unfortunate legacy PKCS#12 reasons). The output of mkcert should have mentioned it, didn’t it?

<!-- gh-comment-id:472283613 --> @FiloSottile commented on GitHub (Mar 13, 2019): The password is “changeit” (for unfortunate legacy PKCS#12 reasons). The output of mkcert should have mentioned it, didn’t it?
Author
Owner

@natiki commented on GitHub (Mar 13, 2019):

@FiloSottile OMG sorry about that, RTFM!!!! It does indeed say that. My apologies for being like a typical user and not reading things.

<!-- gh-comment-id:472285303 --> @natiki commented on GitHub (Mar 13, 2019): @FiloSottile OMG sorry about that, RTFM!!!! It does indeed say that. My apologies for being like a typical user and not reading things.
Author
Owner

@FiloSottile commented on GitHub (Mar 13, 2019):

It’s ok, we all glance over things from time to time :)

<!-- gh-comment-id:472285516 --> @FiloSottile commented on GitHub (Mar 13, 2019): It’s ok, we all glance over things from time to time :)
Author
Owner

@natiki commented on GitHub (Mar 13, 2019):

Seems IIS now belives there are missing intermediates?

image

<!-- gh-comment-id:472285697 --> @natiki commented on GitHub (Mar 13, 2019): Seems IIS now belives there are missing intermediates? ![image](https://user-images.githubusercontent.com/4738140/54255760-740a4680-45ad-11e9-8a71-d9ec972d3a7b.png)
Author
Owner

@FiloSottile commented on GitHub (Mar 13, 2019):

That’s weird, as mkcert does not use intermediates.

The message says “installed”, maybe it wants the root in the system store? In that case running “mkcert -install” might fix it, but that would be a weird requirement.

<!-- gh-comment-id:472286099 --> @FiloSottile commented on GitHub (Mar 13, 2019): That’s weird, as mkcert does not use intermediates. The message says “installed”, maybe it wants the root in the system store? In that case running “mkcert -install” might fix it, but that would be a weird requirement.
Author
Owner

@natiki commented on GitHub (Mar 13, 2019):

I had previously run mkcert -intall and it said it had installed it? Re-ran it just to be sure and the response is:

Using the local CA at "C:\Users\{OmittedForSecurity}\AppData\Local\mkcert

and I can see the CA as:

image

<!-- gh-comment-id:472286652 --> @natiki commented on GitHub (Mar 13, 2019): I had previously run `mkcert -intall` and it said it had installed it? Re-ran it just to be sure and the response is: `Using the local CA at "C:\Users\{OmittedForSecurity}\AppData\Local\mkcert` and I can see the CA as: ![image](https://user-images.githubusercontent.com/4738140/54256018-7caf4c80-45ae-11e9-9f1a-482046e65cf7.png)
Author
Owner

@FiloSottile commented on GitHub (Mar 13, 2019):

I’m afraid we have to wait for someone who actually dealt with IIS, I have never actually used it.

<!-- gh-comment-id:472286857 --> @FiloSottile commented on GitHub (Mar 13, 2019): I’m afraid we have to wait for someone who actually dealt with IIS, I have never actually used it.
Author
Owner

@CW92 commented on GitHub (May 1, 2019):

When using the certificate locally I don't get this issue but when I move it to a VM I get the same error.

Looking at my local machine I have a Certificate created and it is using that (Named "mkcert {Domain}{Username}").

I exported this certificate as .p7b and then imported this on my VM and no longer saw this message pop up in IIS.

<!-- gh-comment-id:488243499 --> @CW92 commented on GitHub (May 1, 2019): When using the certificate locally I don't get this issue but when I move it to a VM I get the same error. Looking at my local machine I have a Certificate created and it is using that (Named "mkcert {Domain}\{Username}"). I exported this certificate as .p7b and then imported this on my VM and no longer saw this message pop up in IIS.
Author
Owner

@natiki commented on GitHub (May 1, 2019):

My case was Windows 10 running on bare metal.

<!-- gh-comment-id:488249083 --> @natiki commented on GitHub (May 1, 2019): My case was Windows 10 running on bare metal.
Author
Owner

@CW92 commented on GitHub (May 1, 2019):

If you go to MMC > Certificates > Choose the Certificate > Certification Path, does this certificate appear at the top level or as a sub certificate?

<!-- gh-comment-id:488281217 --> @CW92 commented on GitHub (May 1, 2019): If you go to MMC > Certificates > Choose the Certificate > Certification Path, does this certificate appear at the top level or as a sub certificate?
Author
Owner

@natiki commented on GitHub (Jun 19, 2019):

Top level
image

<!-- gh-comment-id:503507183 --> @natiki commented on GitHub (Jun 19, 2019): Top level ![image](https://user-images.githubusercontent.com/4738140/59759031-90b3ca00-92d2-11e9-86b7-bf746f6760dc.png)
Author
Owner

@martinib77 commented on GitHub (Jun 24, 2021):

I'm having the same problem. Did somebody find a solution ?

<!-- gh-comment-id:867330535 --> @martinib77 commented on GitHub (Jun 24, 2021): I'm having the same problem. Did somebody find a solution ?
Author
Owner

@CW92 commented on GitHub (Jun 24, 2021):

I'm having the same problem. Did somebody find a solution ?

I am not having the same issue, in Powershell Admin (Don't know if Admin mode is required but I use it for personal preference).

Created a new one running:

  • cd ~ (Users Home Drive - In my case C:\Users\Chris)
  • mkcert -pkcs12 2021-06-24.localtest.me ("2021-06-24.localtest.me" is the Subject Alternate Name for the certificate)
  • mv .\2021-06-24.localtest.me.p12 .\2021-06-24.localtest.me.pfx
  • Import into IIS (Password: changeit)
  • Add certificate to IIS site through Binding

(Screenshot from Powershell)
image

When I import my certificate into IIS I am not getting this, looking at the server certification path I have the top as the machine signing the cert (mkcert -install cert) and then "2021-06-24.localtest.me" (My newly created cert).
(Screenshot from Certificate)
image

When I have had issues it is due to the certificate not containing the top level Signing Certificate, if the one generated from mkcert is missing the signing Certificate then this can be exported from MMC.

  • Start > Run (Windows Key + R)
  • Type MMC /C
  • File > Add/Remove Snap-in... (Crtl + M)
  • Click Certificates > Click "Add >"
  • Select Computer account
  • Click Next > Finish
  • Click OK
  • Expand Certificates > Personal > Certificates
  • Right Click the Certificate generated above (In my case 2021-06-24.localtest.me) > All Tasks > Export
  • Click Next > Select "Yes" to export Private Key > Next > Make sure "Include all certificates in the certification path if possible" is selected > Click Next > Choose Security Type > Click Next > Select where to export to (with file name) > Click Next > Click Finish
  • Import the generated certificate into IIS.

Please let me know if after trying both of these that neither option is working and I will see if I have to do any other steps.

<!-- gh-comment-id:867410752 --> @CW92 commented on GitHub (Jun 24, 2021): > I'm having the same problem. Did somebody find a solution ? I am not having the same issue, in Powershell Admin (Don't know if Admin mode is required but I use it for personal preference). Created a new one running: - cd ~ (Users Home Drive - In my case C:\Users\Chris) - mkcert -pkcs12 2021-06-24.localtest.me ("2021-06-24.localtest.me" is the Subject Alternate Name for the certificate) - mv .\2021-06-24.localtest.me.p12 .\2021-06-24.localtest.me.pfx - Import into IIS (Password: changeit) - Add certificate to IIS site through Binding (Screenshot from Powershell) ![image](https://user-images.githubusercontent.com/47077926/123218944-3dc60c00-d4c4-11eb-9761-107a059b5423.png) When I import my certificate into IIS I am not getting this, looking at the server certification path I have the top as the machine signing the cert (mkcert -install cert) and then "2021-06-24.localtest.me" (My newly created cert). (Screenshot from Certificate) ![image](https://user-images.githubusercontent.com/47077926/123219528-e70d0200-d4c4-11eb-9405-476e76257afe.png) When I have had issues it is due to the certificate not containing the top level Signing Certificate, if the one generated from mkcert is missing the signing Certificate then this can be exported from MMC. - Start > Run (Windows Key + R) - Type MMC /C - File > Add/Remove Snap-in... (Crtl + M) - Click Certificates > Click "Add >" - Select Computer account - Click Next > Finish - Click OK - Expand Certificates > Personal > Certificates - Right Click the Certificate generated above (In my case 2021-06-24.localtest.me) > All Tasks > Export - Click Next > Select "Yes" to export Private Key > Next > Make sure "Include all certificates in the certification path if possible" is selected > Click Next > Choose Security Type > Click Next > Select where to export to (with file name) > Click Next > Click Finish - Import the generated certificate into IIS. Please let me know if after trying both of these that neither option is working and I will see if I have to do any other steps.
Author
Owner

@martinib77 commented on GitHub (Jun 24, 2021):

I did both options.

But the moment i save the Binding on IIS the intermediate certificates error appears.

ie-message

Viewing the certificate, everything is ok

certificate-path

And when i use Chrome to browse the site, it shows as secured site.

secured-site

But then , when my app in .NET Core tries to download a file from the site it gives:

---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid because of errors in the certificate chain: PartialChain

I assume the error is the same that IIS is showing when saving the binding.

<!-- gh-comment-id:867723807 --> @martinib77 commented on GitHub (Jun 24, 2021): I did both options. But the moment i save the Binding on IIS the **intermediate certificates** error appears. ![ie-message](https://user-images.githubusercontent.com/5649614/123287853-71fdf480-d4e5-11eb-8c25-4699265b7cc3.png) Viewing the certificate, everything is ok ![certificate-path](https://user-images.githubusercontent.com/5649614/123288029-93f77700-d4e5-11eb-8c99-a5b3d0509d1b.png) And when i use Chrome to browse the site, it shows as secured site. ![secured-site](https://user-images.githubusercontent.com/5649614/123288326-d8831280-d4e5-11eb-91c2-8a050ac86ab5.png) But then , when my app in .NET Core tries to download a file from the site it gives: ``` ---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid because of errors in the certificate chain: PartialChain ``` I assume the error is the same that IIS is showing when saving the binding.
Author
Owner

@CW92 commented on GitHub (Jun 24, 2021):

I think the issue with .Net Core is It looks like the Subject Alternate Name for the certificate in IIS is "2021-06-24.localtest.me" whereas the binding is localhost which is causing a mismatch preventing the .Net Core application from trusting the certificate.

However I have also found this can be due to the server not trusting the Certificate, to fix this I normally copy the Certificate (and any parents) into Trusted Root CA folder (In MMC) however recently on occasion I have had to add them to Trusted People as well.

<!-- gh-comment-id:867774276 --> @CW92 commented on GitHub (Jun 24, 2021): I think the issue with .Net Core is It looks like the Subject Alternate Name for the certificate in IIS is "2021-06-24.localtest.me" whereas the binding is localhost which is causing a mismatch preventing the .Net Core application from trusting the certificate. However I have also found this can be due to the server not trusting the Certificate, to fix this I normally copy the Certificate (and any parents) into Trusted Root CA folder (In MMC) however recently on occasion I have had to add them to Trusted People as well.
Author
Owner

@martinib77 commented on GitHub (Jun 24, 2021):

Installing on Trusted Root CA folder (In MMC) solved the issue !

Trusted Root CA folder

After installing the generated localhost.pfx certificate, IIS doesn't give the warning message anymore, and .NET Core also trust the certificate.

It looks like the Subject Alternate Name for the certificate in IIS is "2021-06-24.localtest.me" whereas the binding is localhost which is causing a mismatch preventing the .Net Core application from trusting the certificate
The moment i solve the IIS error, it gives me the name mismatch, but generating again the certificate for localhost solved the problem

<!-- gh-comment-id:867797595 --> @martinib77 commented on GitHub (Jun 24, 2021): Installing on **Trusted Root CA folder** (In MMC) solved the issue ! ![Trusted Root CA folder](https://user-images.githubusercontent.com/5649614/123301822-7250bc80-d4f2-11eb-8e64-ec5670095955.png) After installing the generated localhost.pfx certificate, IIS doesn't give the warning message anymore, and .NET Core also trust the certificate. _It looks like the Subject Alternate Name for the certificate in IIS is "2021-06-24.localtest.me" whereas the binding is localhost which is causing a mismatch preventing the .Net Core application from trusting the certificate_ The moment i solve the IIS error, it gives me the name mismatch, but generating again the certificate for localhost solved the problem
Author
Owner

@cam-m commented on GitHub (Dec 11, 2024):

I've just hit this issue.

The problem is that 'mkcert -install' is installing the root CA cert in the Current User Store, and IIS is using the Machine (Local Computer) Store.

When the localhost cert is installed in IIS this puts it in the Machine Store - the CA Cert is missing from the chain because its in a different store - the Current User Store.

Fixing #550 would likely address this issue more permanently, but the workaround is to just export the root CA cert from the Current User Store (certmgr) and import it into Trusted Root Certification in the Local Computer Store (certlm).

Worked for me (Windows 11)

<!-- gh-comment-id:2533268665 --> @cam-m commented on GitHub (Dec 11, 2024): I've just hit this issue. The problem is that 'mkcert -install' is installing the root CA cert in the Current User Store, and IIS is using the Machine (Local Computer) Store. When the localhost cert is installed in IIS this puts it in the Machine Store - the CA Cert is missing from the chain because its in a different store - the Current User Store. Fixing #550 would likely address this issue more permanently, but the workaround is to just export the root CA cert from the Current User Store (certmgr) and import it into Trusted Root Certification in the Local Computer Store (certlm). Worked for me (Windows 11)
Author
Owner

@User00015 commented on GitHub (Jul 22, 2025):

Following the steps to use mkcert to install SSL Certs for IIS has also caused me this issue. Going to chalk this one up to "Probably should just use NGINX".

<!-- gh-comment-id:3103541266 --> @User00015 commented on GitHub (Jul 22, 2025): Following the steps to use mkcert to install SSL Certs for IIS has also caused me this issue. Going to chalk this one up to "Probably should just use NGINX".
Author
Owner

@eriteric commented on GitHub (Oct 1, 2025):

Just to chime in.. I don't think this is an issue with IIS/windows. I have the same issue on some self-hosted docker apps running on linux with nginx :). One was with the obsidian livesync plugin, and another was with n8n, but most apps don't show any error so it was a surprise when I started seeing this pop up only in the last couple days.

Errors in n8n were:

  • getaddrinfo ENOTFOUND website.com
  • and: unable to verify the first certificate

Errors in obsidian livesync:

  • android sslhandshakeexception trust anchor for certification path not found

I was able to solve this in n8n by adding an environment variable that fortunately they made available: NODE_TLS_REJECT_UNAUTHORIZED=0
Which, essentially just turns off this check. Fine for my case in a closed network.

So, it seems some apps check for intermediates as a matter of necessity. Possible for mkcert to help mitigate that? or is this just edge cases? Things to ponder...

<!-- gh-comment-id:3354931442 --> @eriteric commented on GitHub (Oct 1, 2025): Just to chime in.. I don't think this is an issue with IIS/windows. I have the same issue on some self-hosted docker apps running on linux with nginx :). One was with the obsidian livesync plugin, and another was with n8n, but most apps don't show any error so it was a surprise when I started seeing this pop up only in the last couple days. Errors in n8n were: - `getaddrinfo ENOTFOUND website.com` - and: `unable to verify the first certificate` Errors in obsidian livesync: - `android sslhandshakeexception trust anchor for certification path not found` I was able to solve this in n8n by adding an environment variable that fortunately they made available: `NODE_TLS_REJECT_UNAUTHORIZED=0` Which, essentially just turns off this check. Fine for my case in a closed network. So, it seems some apps check for intermediates as a matter of necessity. Possible for mkcert to help mitigate that? or is this just edge cases? Things to ponder...
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/mkcert#89
No description provided.