none
IIS Express self signed certificates. RRS feed

  • Question

  • Hi, I am making a web application and it needs to run under SSL.

    For that reason I have switched in Visual Studio the option SSL Enabled.


     Once I did that I got the following dialog box asking me if I want a self-signed certificate by IIS Express



    I replied with Yes and  IIS Express generated a self-signed certificate that it has been added in my personal certificates, i have moved the certificate to Trusted Root Certificates as shown below 


     

    Once I did that everything worked as expected !!!
    I have to mention that at the time I have runned the following code : netsh http show sslcert 

    and I have seen that IIS Express made bindings to the ports 44300 until 44399 

    below are partially shown the results of my query 


    Now the fun part starts, suddenly my pc shut down from kernel 41 error (probably a problem with my PSU (this is another story :) ))
    when the computer restarts I try to use the SSLURL but I get the following error: ERROR_CONNECTION_RESET - the site does not even loads.


    Therefore, I  re-run the command: netsh http show sslcert

    this time I only got one binding as shown below :




    Since my SSL website has a binding on a port between 44300 - 44399 the above binding is useless therefore i think I found why my SSLURL is not showing up.

    Moving forward, I have decided that I have to manually bind the previously generated SSL certificate to the port that my website uses for this example lets say port 44314.


    therefore I use the following command from CLI: netsh http delete sslcert ipport=0.0.0.0:44314

    Once deleted the entry succesfully I tried to make a new binding using the following command :

    netsh http add sslcert ipport=0.0.0.0:44314 certhash=7d5ca4a11949712b0a24685a13066f9c29c9c9ef appid={214124cd-d05b-4309-9af9-9caa44b2b74a}

    Certhash and Appid are the ones' used before by IIS Express for my certificate.


    I received the following error: 

    SSL Certificate add failed,Error:1312
    A specified logon session does not exist. It may already have been terminated.

    I don't know how to move forward and I need my site to run on SSL (in the development environment). I have disabled and re-enable the SSL Option from the visual studio hoping to get again the message shown in the second picture of this post. Unfortunately IIS had never asked me again for a new self-signed certificate.

    Ps: I have tried to repair IIS in an effort to recreate the bindings but that has not helped either.



    Any advice ?



     

    Wednesday, July 3, 2019 8:45 PM

All replies

  • Hi e-cyprus,

    Welcome to the MSDN forum.

    According to your description, I suggest you could try to use IisExpressAdminCmd command to reset the SSL and the self-hosted certificate.

    Details, you could refer to below command:

    cd C:\Program Files (x86)\IIS Express

    IisExpressAdminCmd.exe setupsslUrl -url:urlofYourSite -UseSelfSigned

    After setting this command, you could close the IIS express and restarted the site from VS.

    Best regards,

    Sara


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Thursday, July 4, 2019 7:58 AM
  • Hi Sara thank you very much for your reply. I already tried your suggestion.

    When i try the command: IisExpressAdminCmd.exe setupsslUrl -url:MySSLURL -UseSelfSigned

    I get the following message:

    SetupsslUrlCommand 'setupsslUrl ' failed.
    An internal error occured.




    • Edited by e-cyprus Thursday, July 4, 2019 9:07 PM dublication
    Thursday, July 4, 2019 2:28 PM
  • Hi e-cyprus,

    Thanks for your update.

    It seems you meet an error, could you please share the detail error message or the screenshot of the current command result? That will help us analysis this issue, thanks for your understanding.

    Best regards,

    Sara


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Friday, July 5, 2019 6:15 AM
  • Friday, July 5, 2019 6:48 AM
  • Do i have a way to debug the ddl causing the issue ?
    I really need to solve this and go forward with the development.
    Friday, July 5, 2019 12:55 PM
  • Hi e-cyprus,

    Thanks for your update.

    It seems the IIS express is corrupted, please try to run the VS installer as administrator and repair it. If this issue persists, please try to uninstall and re-install VS to check it again.

    Best regards,

    Sara


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Monday, July 8, 2019 6:33 AM
  • Repairing of IISExpress is not working,  it seems that it crash and stops suddenly without an error message.
    Reinstalling of Visual Studio is not an option for me, I have too many pluggins installed on VS it would be a nightmare to setup the development environment again.

    If I setup a FULL IIS will I have the same problems ?

    Thank you for your feedback.

    Tuesday, July 9, 2019 7:49 AM
  • Hi e-cyprus,

    Thanks for your detail information.

    After confirmed, please redirect to this appropriate forum: https://forums.asp.net/ for better support, since our forum is to discuss the VS installation issues, thanks for your understanding.

    Best regards,

    Sara


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Tuesday, July 9, 2019 8:42 AM