我正在运行SSL所需的Web服务,并计划切换托pipe提供商。 为了避免我们的用户在DNScaching清除的时候出现停机,我计划在几天内将来自旧服务器的请求代理到新服务器。 旧网站和新网站都运行nginx和openssl。
我有一个设置,似乎在Chrome和Firefox中完美的工作,但在Safari和curl失败。
我旧服务器的nginx(1.6.2)configuration中的代理configuration部分非常简单:
upstream droplet { server zin.droplets.gimlet.us:443; } server { listen 80; listen 443 ssl; server_name demo.gimlet.us; # proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # proxy_ssl_session_reuse off; proxy_set_header Host $host; location / { proxy_pass https://droplet; } error_log /tmp/proxy_error.log; access_log /tmp/proxy_access.log; }
(更改proxy_ssl_protocols和proxy_ssl_session_reuse似乎没有什么区别)
有趣的是,来自Safari和curl的请求不会在我的/ tmp日志中生成日志条目。 但是,在主要的error.log,我得到一个条目,如:
2014/11/21 17:02:08 [alert] 2937#0: worker process 13634 exited on signal 11
curl -v的输出表明一个好的SSL握手发生,然后出现错误:
$ curl -v https://demo.gimlet.us/favicon.ico * About to connect() to demo.gimlet.us port 443 (#0) * Trying 74.50.48.201... * connected * Connected to demo.gimlet.us (74.50.48.201) port 443 (#0) * SSLv3, TLS handshake, Client hello (1): * SSLv3, TLS handshake, Server hello (2): * SSLv3, TLS handshake, CERT (11): * SSLv3, TLS handshake, Server key exchange (12): * SSLv3, TLS handshake, Server finished (14): * SSLv3, TLS handshake, Client key exchange (16): * SSLv3, TLS change cipher, Client hello (1): * SSLv3, TLS handshake, Finished (20): * SSLv3, TLS change cipher, Client hello (1): * SSLv3, TLS handshake, Finished (20): * SSL connection using DHE-RSA-AES256-SHA * Server certificate: * subject: description=e08NImA1P8R1ukwA; C=US; ST=Wisconsin; L=Madison; O=Nathanael Vack; CN=*.gimlet.us; [email protected] * start date: 2014-04-10 16:59:37 GMT * expire date: 2016-04-11 09:29:37 GMT * subjectAltName: demo.gimlet.us matched * issuer: C=IL; O=StartCom Ltd.; OU=Secure Digital Certificate Signing; CN=StartCom Class 2 Primary Intermediate Server CA * SSL certificate verify ok. > GET /favicon.ico HTTP/1.1 > User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8z zlib/1.2.5 > Host: demo.gimlet.us > Accept: */* > * Empty reply from server * Connection #0 to host demo.gimlet.us left intact curl: (52) Empty reply from server * Closing connection #0 * SSLv3, TLS alert, Client hello (1):
还值得注意的是,在做
$ curl http://demo.gimlet.us/favicon.ico
工作正常。
我觉得我在这里错过了一些非常基本的东西。 任何build议,我可以在哪里寻找更多的想法?
注意到SSL似乎与同一服务器上的其他域一起工作,我添加了更多的SSLconfiguration指令。 这个:
ssl_session_cache shared:SSL:10m;
治愈了段错。
我相信这张票是潜在的问题; nginx指责OpenSSL。
有效的nginx级别的修复(以及我现在正在做什么,我知道这是什么)是在http上下文中完成你的nginx范围的SSLconfiguration,而不是在一堆server上下文中重复它。