Thread Fehler bei SSL Verbindung (13 answers)
Opened by Rolf Schaufelberger at 2017-03-20 08:50

Linuxer
 2017-03-20 22:54
#186268 #186268
User since
2006-01-27
3870 Artikel
HausmeisterIn

user image
Da ich das verwendete System nicht kenne, kann ich Dir darauf keine Antwort geben.
Allgemeine Fragen, die mir da einfallen, wären:
Ist das curl wirklich dynamisch gelinkt oder hat es evtl. die SSL-Geschichten statisch eingebunden?
Wenn dynamisch verlinkt, verwendet es die gleiche Bibliothek wie das openssl?

Bei mir scheinen beide Programme und auch das Net::SSLeay-Modul die gleiche Bibliotheken zu nutzen:

more (5.3kb):
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
$ ldd $(which openssl)
/usr/lib/arm-linux-gnueabihf/libarmmem.so (0xb6f6f000)
libssl.so.1.0.0 => /usr/lib/arm-linux-gnueabihf/libssl.so.1.0.0 (0xb6f09000)
libcrypto.so.1.0.0 => /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0 (0xb6d9b000)
libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6d88000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6c47000)
/lib/ld-linux-armhf.so.3 (0x7f55c000)

$ ldd $(which curl)
/usr/lib/arm-linux-gnueabihf/libarmmem.so (0xb6f7e000)
libcurl.so.4 => /usr/lib/arm-linux-gnueabihf/libcurl.so.4 (0xb6f01000)
libz.so.1 => /lib/arm-linux-gnueabihf/libz.so.1 (0xb6eda000)
libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6eb2000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6d71000)
/lib/ld-linux-armhf.so.3 (0x7f61e000)
libidn.so.11 => /usr/lib/arm-linux-gnueabihf/libidn.so.11 (0xb6d30000)
librtmp.so.1 => /usr/lib/arm-linux-gnueabihf/librtmp.so.1 (0xb6d07000)
libssh2.so.1 => /usr/lib/arm-linux-gnueabihf/libssh2.so.1 (0xb6ce5000)
libssl.so.1.0.0 => /usr/lib/arm-linux-gnueabihf/libssl.so.1.0.0 (0xb6c8b000)
libcrypto.so.1.0.0 => /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0 (0xb6b1d000)
libgssapi_krb5.so.2 => /usr/lib/arm-linux-gnueabihf/libgssapi_krb5.so.2 (0xb6ad2000)
libkrb5.so.3 => /usr/lib/arm-linux-gnueabihf/libkrb5.so.3 (0xb6a1e000)
libk5crypto.so.3 => /usr/lib/arm-linux-gnueabihf/libk5crypto.so.3 (0xb69e0000)
libcom_err.so.2 => /lib/arm-linux-gnueabihf/libcom_err.so.2 (0xb69cd000)
liblber-2.4.so.2 => /usr/lib/arm-linux-gnueabihf/liblber-2.4.so.2 (0xb69b1000)
libldap_r-2.4.so.2 => /usr/lib/arm-linux-gnueabihf/libldap_r-2.4.so.2 (0xb695c000)
libgnutls-deb0.so.28 => /usr/lib/arm-linux-gnueabihf/libgnutls-deb0.so.28 (0xb684f000)
libhogweed.so.2 => /usr/lib/arm-linux-gnueabihf/libhogweed.so.2 (0xb6816000)
libnettle.so.4 => /usr/lib/arm-linux-gnueabihf/libnettle.so.4 (0xb67d6000)
libgmp.so.10 => /usr/lib/arm-linux-gnueabihf/libgmp.so.10 (0xb6764000)
libgcrypt.so.20 => /lib/arm-linux-gnueabihf/libgcrypt.so.20 (0xb66c0000)
libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb66ad000)
libkrb5support.so.0 => /usr/lib/arm-linux-gnueabihf/libkrb5support.so.0 (0xb6694000)
libkeyutils.so.1 => /lib/arm-linux-gnueabihf/libkeyutils.so.1 (0xb6689000)
libresolv.so.2 => /lib/arm-linux-gnueabihf/libresolv.so.2 (0xb6664000)
libsasl2.so.2 => /usr/lib/arm-linux-gnueabihf/libsasl2.so.2 (0xb663c000)
libp11-kit.so.0 => /usr/lib/arm-linux-gnueabihf/libp11-kit.so.0 (0xb65fb000)
libtasn1.so.6 => /usr/lib/arm-linux-gnueabihf/libtasn1.so.6 (0xb65db000)
libgpg-error.so.0 => /lib/arm-linux-gnueabihf/libgpg-error.so.0 (0xb65bd000)
libffi.so.6 => /usr/lib/arm-linux-gnueabihf/libffi.so.6 (0xb65ac000)
libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb657f000)

$ ldd /usr/lib/arm-linux-gnueabihf/perl5/5.20/auto/Net/SSLeay/SSLeay.so
/usr/lib/arm-linux-gnueabihf/libarmmem.so (0xb6ea1000)
libssl.so.1.0.0 => /usr/lib/arm-linux-gnueabihf/libssl.so.1.0.0 (0xb6e3b000)
libcrypto.so.1.0.0 => /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.0 (0xb6ccd000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6b8c000)
/lib/ld-linux-armhf.so.3 (0x7f61d000)
libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6b79000)

Wo bei Dir die *.so Dateien der Module liegen, musst Du bei Dir schauen.
Ich nutze oft perldoc -l um mich grob zu orientieren und schaue dann ab da weiter.

Code: (dl )
1
2
3
4
5
6
7
8
9
10
$ perldoc -l Net::SSLeay
/usr/lib/arm-linux-gnueabihf/perl5/5.20/Net/SSLeay.pod
/code]

Damit kenn ich das verwendete Perl-Grundverzeichnis (hier wohl [c]/usr/lib/arm-linux-gnueabihf/perl5/5.20/[/c]) ; und dort hoffe ich dann auf ein Unterverzeichnis [c]auto[/c], worin dann die .so Dateien liegen.

Oder man jagt [c]find[/c] durchs Dateisystem:

[code]
find /usr/lib/arm-linux-gnueabihf/perl5/5.20 -type f -name "*.so"






Hast Du schon mal versucht, mit dem openssl selber eine Verbindung aufzubaufen?
edit: OK, hast Du anscheinend. Aber leider bleibt unklar, was dabei rauskam...

Code: (dl )
openssl s_client -connect SERVERNAME:PORT


SERVERNAME:PORT musst Du durch Deine entsprechenden Werte ersetzen.

Wenn das erfolgreich ist, solltest Du eine längere Ausgabe sehen, wenn die SSL-Verbindung erfolgreich aufgebaut wurde. Die Ausgabe bleibt augenscheinlich "hängen", weil dann der Webserver dahinter auf Input wartet. Mit CTRL+D kann man das in der Regel abbrechen.
Oder man fordert einfach eine Seite an, in dem man den HTTP-Request manuell eintippt:

Code: (dl )
1
2
GET / HTTP/1.1
host:SERVERNAME


Zur Ausgabe: Neben der "Certificate chain" und dem empfangenen "Server certificate" wäre wohl das Ende der Ausgabe interessant:


Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
...

No client certificate CA names sent
---
SSL handshake has read 5024 bytes and written 415 bytes
---
New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES256-GCM-SHA384
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol : TLSv1.2
Cipher : ECDHE-RSA-AES256-GCM-SHA384
Session-ID: xxx
Session-ID-ctx:
Master-Key: xxx
Key-Arg : None
PSK identity: None
PSK identity hint: None
SRP username: None
TLS session ticket lifetime hint: 300 (seconds)
TLS session ticket:
... hexdump
Start Time: 1490045650
Timeout : 300 (sec)
Verify return code: 0 (ok)
---

Last edited: 2017-03-20 22:56:02 +0100 (CET)
meine Beiträge: I.d.R. alle Angaben ohne Gewähr und auf Linux abgestimmt!
Die Sprache heisst Perl, nicht PERL. - Bitte Crossposts als solche kenntlich machen!

View full thread Fehler bei SSL Verbindung