Verbindungsfehler nach dem Festlegen von SSL für Nginx

539
diogo.abdalla

Ich versuche, https für einen Client auf Nginx einzurichten und klappt nicht richtig

Nachdem ich die Zertifikatsdateien hochgeladen und in der Serverkonfiguration eingerichtet habe, erhalte ich einen "Secure Connection Failed" (FF), wenn ich mit https auf den Server zugreifen möchte

Ich weiß nicht viel über Nginx, also folgte ich den Tutorials und dem Beispiel auf Nginx.conf

Die Zertifikatsdateien wurden nicht von mir generiert, mein Client wurde mir dann zugesandt, daher kann ich nicht sicher sein, dass sie in Ordnung sind

Mein Nginx Conf

server { listen 80; server_name almap-intranet.almapbbdo.com.br;  charset utf-8;  root /var/www/html/wordpress; index index.php index.html index.htm;  location / { try_files $uri $uri/ /index.php?q=$uri&$args; #try_files $uri $uri/ =404; } error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; }  location ~ \.php$ { try_files $uri =404; fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }  # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # location ~ /\.ht { deny all; } }  server { listen 443 ssl http2 default_server;  ssl on; ssl_certificate /etc/cert/almapbbdo.com.br.crt; ssl_certificate_key /etc/cert/almapbbdo.com.br.key;  ssl_session_cache shared:SSL:1m; ssl_session_timeout 10m; ssl_ciphers 'EECDH+AES128:EECDH+AES256:+SHA:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:RSA+3DES:!DSS'; ssl_prefer_server_ciphers on; ssl_protocols TLSv1 TLSv1.1 TLSv1.2;  server_name almap-intranet.almapbbdo.com.br;  charset utf-8;  root /var/www/html/wordpress; index index.php index.html index.htm;  location / { try_files $uri $uri/ /index.php?q=$uri&$args; #try_files $uri $uri/ =404; } error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; }  location ~ \.php$ { try_files $uri =404; fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }  # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # location ~ /\.ht { deny all; } } 

nginx -t sagt, die Konfiguration ist in Ordnung

Laufen

telnet almap-intranet.almapbbdo.com.br 443 

es verbindet

Laufen

curl -vvvvvv https://almap-intranet.almapbbdo.com.br 

Es gibt mir:

* Rebuilt URL to: https://almap-intranet.almapbbdo.com.br/ * Hostname was NOT found in DNS cache * Trying 10.0.1.16... * Connected to almap-intranet.almapbbdo.com.br (10.0.1.16) port 443 (#0) * successfully set certificate verify locations: * CAfile: none CApath: /etc/ssl/certs * SSLv3, TLS Unknown, Unknown (22): * SSLv3, TLS handshake, Client hello (1): * Unknown SSL protocol error in connection to almap-intranet.almapbbdo.com.br:443  * Closing connection 0 curl: (35) Unknown SSL protocol error in connection to almap-intranet.almapbbdo.com.br:443  

Schließlich versucht

openssl s_client -debug -msg -connect almap-intranet.almapbbdo.com.br:443 

Es gibt mir das:

CONNECTED(00000003) >>> ??? [length 0005] 16 03 01 00 ab >>> TLS 1.2Handshake [length 00ab], ClientHello 01 00 00 a7 03 03 7f af 3f af d0 5e f0 22 69 ce 19 29 e5 91 16 39 41 99 ac ed 2a 5c b0 8f 62 48 3a 28 64 e9 6a a0 00 00 38 c0 2c c0 30 00 9f cc a9 cc a8 cc aa c0 2b c0 2f 00 9e c0 24 c0 28 00 6b c0 23 c0 27 00 67 c0 0a c0 14 00 39 c0 09 c0 13 00 33 00 9d 00 9c 00 3d 00 3c 00 35 00 2f 00 ff 01 00 00 46 00 0b 00 04 03 00 01 02 00 0a 00 0a 00 08 00 1d 00 17 00 19 00 18 00 23 00 00 00 16 00 00 00 17 00 00 00 0d 00 20 00 1e 06 01 06 02 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 03 02 03 03 02 01 02 02 02 03 write to 0x247a710 [0x248aea0] (176 bytes => 176 (0xB0)) 0000 - 16 03 01 00 ab 01 00 00-a7 03 03 7f af 3f af d0 .............?.. 0010 - 5e f0 22 69 ce 19 29 e5-91 16 39 41 99 ac ed 2a ^."i..)...9A...* 0020 - 5c b0 8f 62 48 3a 28 64-e9 6a a0 00 00 38 c0 2c \..bH:(d.j...8., 0030 - c0 30 00 9f cc a9 cc a8-cc aa c0 2b c0 2f 00 9e .0.........+./.. 0040 - c0 24 c0 28 00 6b c0 23-c0 27 00 67 c0 0a c0 14 .$.(.k.#.'.g.... 0050 - 00 39 c0 09 c0 13 00 33-00 9d 00 9c 00 3d 00 3c .9.....3.....=.< 0060 - 00 35 00 2f 00 ff 01 00-00 46 00 0b 00 04 03 00 .5./.....F...... 0070 - 01 02 00 0a 00 0a 00 08-00 1d 00 17 00 19 00 18 ................ 0080 - 00 23 00 00 00 16 00 00-00 17 00 00 00 0d 00 20 .#.............  0090 - 00 1e 06 01 06 02 06 03-05 01 05 02 05 03 04 01 ................ 00a0 - 04 02 04 03 03 01 03 02-03 03 02 01 02 02 02 03 ................ read from 0x247a710 [0x2481bd3] (5 bytes => -1 (0xFFFFFFFFFFFFFFFF)) write:errno=104 --- no peer certificate available --- No client certificate CA names sent --- SSL handshake has read 0 bytes and written 176 bytes Verification: OK --- New, (NONE), Cipher is (NONE) Secure Renegotiation IS NOT supported Compression: NONE Expansion: NONE No ALPN negotiated SSL-Session: Protocol : TLSv1.2 Cipher : 0000 Session-ID:  Session-ID-ctx:  Master-Key:  PSK identity: None PSK identity hint: None SRP username: None Start Time: 1540328518 Timeout : 7200 (sec) Verify return code: 0 (ok) Extended master secret: no --- 

Scheint ein Handshake-Fehler zu sein, aber ich habe keine Ahnung, warum. Ich habe versucht, nach dem Fehler zu suchen, und versuchte viele zufällige Korrekturen, die ich gefunden habe, ohne Erfolg: immer der gleiche Fehler

Wie kann ich das besser debuggen und einschränken? Ist meine Konfiguration in Ordnung? Jede Hilfe wird sehr willkommen sein

0

1 Antwort auf die Frage

1
Richie086

Ich bin mir nicht sicher, ob dies etwas damit zu tun hat, aber ich habe bei der Ausgabe des curl-Befehls bemerkt, dass ich sehe

 CApath: /etc/ssl/certs 

Ich sehe jedoch in Ihrer nginx.conf-Datei

 ssl_certificate /etc/cert/almapbbdo.com.br.crt; ssl_certificate_key /etc/cert/almapbbdo.com.br.key; 

Gibt es die Zertifikate an beiden Standorten? Wenn ja, sind es die gleichen Dateien?

Auch aus dem Internet bemerkt, wenn ich versuche, almap-intranet.almapbbdo.com.br mit dem Befehl zu scannen nmap almap-intranet.almapbbdo.com.br

Starting Nmap 6.00 ( http://nmap.org ) at 2018-10-23 15:39 PDT Nmap scan report for almap-intranet.almapbbdo.com.br (179.191.94.182) Host is up (0.20s latency). rDNS record for 179.191.94.182: mvx-179-191-94-182.mundivox.com Not shown: 999 filtered ports PORT STATE SERVICE 80/tcp open http  Nmap done: 1 IP address (1 host up) scanned in 16.17 seconds 

Könnte eine Firewall-Sache sein, aber ich sehe keinen offenen Port 443.

Es war beides: Die Zertifikate wurden nicht unter / etc / ssl / certs abgelegt (ich wusste nicht, dass sie dort sein mussten). Ich habe dann dort kopiert und das conf geändert. Außerdem wurde die 443 ordnungsgemäß geöffnet (dies wurde vom Netzwerkadministrator gelöst). Vielen Dank diogo.abdalla vor 5 Jahren 0
Oh cool, das hat den Trick gemacht? froh, dass ich helfen konnte! Richie086 vor 5 Jahren 0