davfs - Falha no handshake SSL: erro SSL: falha de handshake de alerta sslv3

2

Estou tentando montar um WebDAV remoto (OwnCloud) usando https na minha máquina Ubuntu 12.04.

Eu corro este comando e ele me pede um nome de usuário e senha

sudo mount -t davfs -o uid=ne,gid=users https://example/owncloud/remote.php/webdav/ /mount/remote

Eu então recebo o erro

/sbin/mount.davfs: Mounting failed. SSL handshake failed: SSL error: sslv3 alert handshake failure

Outras máquinas (incluindo Android) podem se conectar ao WebDAVS corretamente.

Como posso evitar esse erro? O certificado é assinado pela CloudFlare, se isso fizer diferença - mas isso não parece causar um problema para nenhum outro sistema que esteja acessando a instância OwnCloud.

Rodando curl -v https://example.com tudo parece bem

* About to connect() to example.com port 443 (#0)
*   Trying 104.28.29.14... connected
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* 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 ECDHE-ECDSA-AES128-SHA
* Server certificate:
*    subject: OU=Domain Control Validated; OU=PositiveSSL Multi-Domain; CN=sni29581.cloudflaressl.com
*    start date: 2014-10-26 00:00:00 GMT
*    expire date: 2015-09-30 23:59:59 GMT
*    subjectAltName: example.com matched
*    issuer: C=GB; ST=Greater Manchester; L=Salford; O=COMODO CA Limited; CN=COMODO ECC Domain Validation Secure Server CA 2
*    SSL certificate verify ok.
> GET / HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: example.com
> Accept: */*
> 
< HTTP/1.1 302 Moved Temporarily
< Server: cloudflare-nginx
< Date: Mon, 27 Oct 2014 11:30:08 GMT
< Content-Type: text/html
< Transfer-Encoding: chunked
< Connection: keep-alive
< Set-Cookie: __cfduid=da7fc86a1e00780f7eea162120e2c4fe51414409408265; expires=Mon, 23-Dec-2019 23:50:00 GMT; path=/; domain=.example.com; HttpOnly
< Set-Cookie: DYNSRV=lin194; path=/
< CF-RAY: 17fe8f51aaa71365-LHR
< 
* Connection #0 to host example.com left intact
* Closing connection #0
* SSLv3, TLS alert, Client hello (1):

Eu também tentei openssl s_client -host example.com -port 443 , mas isso me dá Verify return code: 20 (unable to get local issuer certificate)

CONNECTED(00000003)
depth=1 C = BE, O = GlobalSign nv-sa, CN = GlobalSign Organization Validation CA - G2
verify error:num=20:unable to get local issuer certificate
verify return:0
---
Certificate chain
 0 s:/C=US/ST=CA/L=San Francisco/O=CloudFlare, Inc./CN=ssl2000.cloudflare.com
   i:/C=BE/O=GlobalSign nv-sa/CN=GlobalSign Organization Validation CA - G2
 1 s:/C=BE/O=GlobalSign nv-sa/CN=GlobalSign Organization Validation CA - G2
   i:/C=BE/O=GlobalSign nv-sa/OU=Root CA/CN=GlobalSign Root CA
---
Server certificate
-----BEGIN CERTIFICATE-----
(truncated)
bJLtKDaYbNmULxY=
-----END CERTIFICATE-----
subject=/C=US/ST=CA/L=San Francisco/O=CloudFlare, Inc./CN=ssl2000.cloudflare.com
issuer=/C=BE/O=GlobalSign nv-sa/CN=GlobalSign Organization Validation CA - G2
---
No client certificate CA names sent
---
SSL handshake has read 3158 bytes and written 363 bytes
---
New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES128-SHA
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
    Protocol  : TLSv1.1
    Cipher    : ECDHE-RSA-AES128-SHA
    Session-ID: EAC9072E6FFBD3E7AEA20B6C4D57F229DCC887CFAB08C2D47C0A546318A794E0
    Session-ID-ctx: 
    Master-Key: 50ED2846908537665D348FCB07BB69ACEAD182F062F8235E5C7ED4958B4D446D70701E4C6876DE2DA06322BA090C46D5
    Key-Arg   : None
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    TLS session ticket lifetime hint: 64800 (seconds)
    TLS session ticket:
    0000 - f1 98 d3 dc 67 02 22 1f-24 88 b7 dc 1c 1a 13 6a   ....g.".$......j
    (truncated)
    Start Time: 1414409459
    Timeout   : 300 (sec)
    Verify return code: 20 (unable to get local issuer certificate)

Eu tentei atualizar para o mais recente libneon mas isso não fez diferença.

Atualizar

Desde a atualização para o OpenSSL mais recente, agora recebo um erro diferente

SSL handshake failed: SSL alert received: Handshake failed

Como sugerido em outro lugar, executando openssl s_client -host example.com -port 443 -ssl3 returns:

Verify return code: 0 (ok)

Eu tenho compilado e instalado a libneon 30.1

./configure --prefix=/usr --enable-shared --with-ssl=openssl --disable-static

mas o erro persiste.

    
por Terence Eden 27.10.2014 / 12:45

1 resposta

1

Certo, aqui está o que eu fiz!

Agarre libneon 30.1 - e extraia para um diretório.

Compile

./configure --prefix=/usr --enable-shared --with-ssl=openssl --disable-static
make
sudo make install

Precisamos agora substituir o antigo libneon-gnutls.so - e queremos que o resultado final seja parecido com

/usr/lib/libneon-gnutls.so.27 -> /usr/lib/libneon.so.27
/usr/lib/libneon.so -> libneon.so.27.3.1
/usr/lib/libneon.so.27 -> libneon.so.27.3.1

Primeiro, faça o backup da versão antiga. sudo mv /usr/lib/libneon-gnutls.so.27 /usr/lib/libneon-gnutls.so.27.old

Em seguida, em /usr/lib/

sudo ln -s /usr/lib/libneon.so.27.3.1 libneon.so.27 
sudo ln -s /usr/lib/libneon-gnutls.so.27.3.1 libneon.so 
sudo ln -s /usr/lib/libneon.so.27 libneon-gnutls.so.27

Isso fez tudo funcionar!

    
por Terence Eden 27.10.2014 / 20:15