forthrin
forthrin

Reputation: 2777

Redirect https to http without causing client errors

I have developed an app which talks to a server over https.

I recently discovered that my certificate has expired, and now the app refuses to talk to the server.

NSURLConnection/CFURLConnection (kCFStreamErrorDomainSSL, -9814)

How can I do a quick fix so that my app will work (insecurely), until I can renew my certificate?

I tried the following, but the app still protests (as does browsers).

  server {
    ssl on;
    ssl_certificate ssl/server.crt;
    ssl_certificate_key ssl/server.key; 
    listen 443;
    rewrite ^ http://$http_host$uri permanent; # temporary workaround
  }

Upvotes: 0

Views: 339

Answers (2)

VBart
VBart

Reputation: 15110

It is fundamentally impossible.

TLS handshake and all checks are done before any request will be sent. This is what "security" is about.

Upvotes: 2

Mohammad AbuShady
Mohammad AbuShady

Reputation: 42899

convert the ssl server to normal server and create a new ssl server that redirects all requests

server {
    listen 443;
    server_name whatever.com www.whatever.com;
    return 301 http://$http_host$request_uri;
}
server {
    listen 80;
    server_name whatever.com www.whatever.com;
    # old configurations from the ssl server
}

Upvotes: 0

Related Questions