cannot access ssl-secured website on the server side

5,007

Solution 1

Can add hosts entry for the website and access it using domain name. This way the SSL handshake will work

Solution 2

If you access your site by name localhost and when your SSL certificate is configured to a hostname (or some other name), your client may refuse to connect to it. It is difficult to say how to fix the problem without knowing the specifics, but you can either try making your requests with the same name that is in the SSL certificate or try turning off client server validation, but then you lose the security SSL is providing.

Share:
5,007

Related videos on Youtube

Levi Johansen
Author by

Levi Johansen

I've been programming and developing software and web-based solutions for most of my life, it is both a passion and a profession to me. In 2016 I startet my own business, after a three-and-a-half year engagement in one of Scandinavias largest companies in alarm systems for search-and-rescue groups and industry safety.

Updated on September 18, 2022

Comments

  • Levi Johansen
    Levi Johansen over 1 year

    I am having problems accessing a website, that recentely got SSL-security, on the server side.

    Accessing the website like normal is not a problem, but when I try to open the website on the server that hosts it - it simply will not open.

    This is not the only site on this server and I can access all of them, except the ones that has SSL security.


    This causes a problem because the website in question contains an API-service and some of the other sites need to connect to this API.

    But connecting to this website through xmlHttpRequest (and other such codes) is not working.

    I would prefer not to have to rewrite all the codes for these other sites, when all the functionality is available in the API. (This would also mean making changes in so many different places as the services evolve and change.)

    What can cause this problem and how do I fix it?


    EDIT: There is another SSL-secured site on this server, and I was misinformed about its status. This other website can be accessed on the server side. I will go through all settings on the IIS and firewall on the server to find why they behave differently.

    EDIT: I've found a solution by changing the rewrite rule - which forces the use of https - to not apply to the internal address (127.0.0.1). I am now able to access the website from the server-side.

    This does not solve the problem, it is just a temporary fix to avoid the problem.

    • MichelZ
      MichelZ about 10 years
      Anything firewall related on there?
    • Levi Johansen
      Levi Johansen about 10 years
      I don't think so, but I'll check.
  • isido
    isido about 10 years
    What error message you get, when trying to connect from client? Some clients, like curl doesn't accept self-signed certificates by default which browsers do (although not without complaining).
  • isido
    isido about 10 years
    Ok. What happens with https://localhost and https://127.0.0.1 ?(If the latter works, then its's probably ipv6 issue) Also, can you get more detailed error code from IIS logs: support.microsoft.com/kb/318380/en-us ?
  • Levi Johansen
    Levi Johansen over 4 years
    This issue was avoided by making an exception in the rewrite rules for IP 127.0.0.1. That has been the solution since I posted this, and we simply forgot about it. The problem resurfaced a month ago, and I've learned to use the hosts file, so I solved it using your suggestion. I've therefore marked this as the correct answer. Thanks :)