itinance / itinance/react-native-fs

downloadFile randomly fails SSL negatiation on Android 4.4

Open
#446 3 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
C++
Stars
5k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

I think the problem is related to using SSLv3 for downloads. I have SSLv3 disabled in the server, but for some reason the phone tries to use SSLv3. I believe it is an Android bug. Could it be possible to disable SSLv3?

Here there is an explanation on how to disable SSLv3: https://stackoverflow.com/questions/29916962/javax-net-ssl-sslhandshakeexception-javax-net-ssl-sslprotocolexception-ssl-han

this is the logcat output.

```
02-20 10:32:09.477 18245-18513/? I/System.out: [socket][7] connection xxx:443;LocalPort=60284(5000)
02-20 10:32:09.477 18245-18513/? I/System.out: [CDS]connect[xxx:443] tm:5
02-20 10:32:09.478 18245-18513/? D/Posix: [Posix_connect Debug]Process xxx :443
02-20 10:32:09.518 18245-18513/? I/System.out: [socket][/192.168.100.50:60284] connected
02-20 10:32:09.518 18245-18513/? I/System.out: [CDS]rx timeout:15000
02-20 10:32:09.521 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 NativeCrypto_SSL_do_handshake fd=0x1ef00005 shc=0x20f00009 timeout_millis=15000 client_mode=1 npn=0x0
02-20 10:32:09.521 18245-18513/? D/NativeCrypto: doing handshake ++
02-20 10:32:09.521 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 info_callback where=0x10 ret=1
02-20 10:32:09.521 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 handshake start in UNKWN before/connect initialization
02-20 10:32:09.521 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 info_callback ignored
02-20 10:32:09.521 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 info_callback where=0x1001 ret=1
02-20 10:32:09.521 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 SSL_connect:UNKWN before/connect initialization
02-20 10:32:09.521 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 info_callback ignored
02-20 10:32:09.522 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 info_callback where=0x1001 ret=1
02-20 10:32:09.522 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 SSL_connect:3WCH_A SSLv3 write client hello A
02-20 10:32:09.522 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 info_callback ignored
02-20 10:32:09.522 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 info_callback where=0x1002 ret=-1
02-20 10:32:09.522 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 SSL_connect:error exit in 3RSH_A SSLv3 read server hello A
02-20 10:32:09.522 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 info_callback ignored
02-20 10:32:09.522 18245-18513/? D/NativeCrypto: doing handshake -- ret=-1
02-20 10:32:09.522 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 NativeCrypto_SSL_do_handshake ret=-1 errno=11 sslError=2 timeout_millis=15000
02-20 10:32:09.545 18245-18245/? W/ResourceType: No package identifier when getting name for resource number 0x000005b3
02-20 10:32:09.546 18245-18245/? W/ResourceType: No package identifier when getting name for resource number 0x000005b7
02-20 10:32:09.547 18245-18245/? W/ResourceType: No package identifier when getting name for resource number 0x000005b9
02-20 10:32:09.555 18245-18245/? W/ResourceType: No package identifier when getting name for resource number 0x000005b3
02-20 10:32:09.556 18245-18245/? W/ResourceType: No package identifier when getting name for resource number 0x000005b7
02-20 10:32:09.557 18245-18245/? W/ResourceType: No package identifier when getting name for resource number 0x000005b9
02-20 10:32:09.561 18245-18513/? D/NativeCrypto: doing handshake ++
02-20 10:32:09.562 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 info_callback where=0x1001 ret=1
02-20 10:32:09.562 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 SSL_connect:3RSH_A SSLv3 read server hello A
02-20 10:32:09.562 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 info_callback ignored
02-20 10:32:09.563 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 info_callback where=0x1001 ret=1
02-20 10:32:09.563 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 SSL_connect:3RFINA SSLv3 read finished A
02-20 10:32:09.563 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 info_callback ignored
02-20 10:32:09.563 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 info_callback where=0x1001 ret=1
02-20 10:32:09.563 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 SSL_connect:3WCCSA SSLv3 write change cipher spec A
02-20 10:32:09.563 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 info_callback ignored
02-20 10:32:09.563 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 info_callback where=0x1001 ret=1
02-20 10:32:09.563 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 SSL_connect:3WFINA SSLv3 write finished A
02-20 10:32:09.563 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 info_callback ignored
02-20 10:32:09.564 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 info_callback where=0x1001 ret=1
02-20 10:32:09.564 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 SSL_connect:3FLUSH SSLv3 flush data
02-20 10:32:09.564 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 info_callback ignored
02-20 10:32:09.564 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 info_callback where=0x20 ret=1
02-20 10:32:09.564 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 handshake done in SSLOK SSL negotiation finished successfully
02-20 10:32:09.564 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 info_callback calling handshakeCompleted
02-20 10:32:09.564 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 info_callback completed
02-20 10:32:09.564 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 info_callback where=0x1002 ret=1
02-20 10:32:09.564 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 SSL_connect:ok exit in SSLOK SSL negotiation finished successfully
02-20 10:32:09.564 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 info_callback ignored
02-20 10:32:09.564 18245-18513/? D/NativeCrypto: doing handshake -- ret=1
02-20 10:32:09.564 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 NativeCrypto_SSL_interrupt
02-20 10:32:09.564 18245-18513/? D/NativeCrypto: sslNotify, appData=0x6d9c3c38 ret=1
02-20 10:32:09.564 18245-18513/? D/NativeCrypto: sslNotify, appData=0x6d9c3c38 ret=1
02-20 10:32:09.565 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 info_callback where=0x4008 ret=256
02-20 10:32:09.565 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 SSL3 alert write:W:CN warning close notify
02-20 10:32:09.565 18245-18513/? D/NativeCrypto: ssl=0x6de9d320 info_callback ignored
02-20 10:32:09.565 18245-18513/? I/System.out: [CDS]close[60284]
02-20 10:32:09.565 18245-18513/? I/System.out: close [socket][/0.0.0.0:60284]
02-20 10:32:09.566 18245-18513/? I/System.out: [socket][8] connection xxx:443;LocalPort=43926(5000)
02-20 10:32:09.567 18245-18513/? I/System.out: [CDS]connect[xxx:443] tm:5
02-20 10:32:09.567 18245-18513/? D/Posix: [Posix_connect Debug]Process xxx :443
02-20 10:32:09.608 18245-18513/? I/System.out: [socket][/192.168.100.50:43926] connected
02-20 10:32:09.608 18245-18513/? I/System.out: [CDS]rx timeout:15000
02-20 10:32:09.610 18245-18513/? D/NativeCrypto: ssl=0x68db8ff0 NativeCrypto_SSL_do_handshake fd=0x21500005 shc=0x25200009 timeout_millis=15000 client_mode=1 npn=0x0
02-20 10:32:09.610 18245-18513/? D/NativeCrypto: doing handshake ++
02-20 10:32:09.610 18245-18513/? D/NativeCrypto: ssl=0x68db8ff0 info_callback where=0x10 ret=1
02-20 10:32:09.610 18245-18513/? D/NativeCrypto: ssl=0x68db8ff0 handshake start in UNKWN before/connect initialization
02-20 10:32:09.610 18245-18513/? D/NativeCrypto: ssl=0x68db8ff0 info_callback ignored
02-20 10:32:09.610 18245-18513/? D/NativeCrypto: ssl=0x68db8ff0 info_callback where=0x1001 ret=1
02-20 10:32:09.610 18245-18513/? D/NativeCrypto: ssl=0x68db8ff0 SSL_connect:UNKWN before/connect initialization
02-20 10:32:09.610 18245-18513/? D/NativeCrypto: ssl=0x68db8ff0 info_callback ignored
02-20 10:32:09.610 18245-18513/? D/NativeCrypto: ssl=0x68db8ff0 info_callback where=0x1001 ret=1
02-20 10:32:09.610 18245-18513/? D/NativeCrypto: ssl=0x68db8ff0 SSL_connect:23WCHA SSLv2/v3 write client hello A
02-20 10:32:09.610 18245-18513/? D/NativeCrypto: ssl=0x68db8ff0 info_callback ignored
02-20 10:32:09.610 18245-18513/? D/NativeCrypto: ssl=0x68db8ff0 info_callback where=0x1002 ret=-1
02-20 10:32:09.610 18245-18513/? D/NativeCrypto: ssl=0x68db8ff0 SSL_connect:error exit in 23RSHA SSLv2/v3 read server hello A
02-20 10:32:09.610 18245-18513/? D/NativeCrypto: ssl=0x68db8ff0 info_callback ignored
02-20 10:32:09.610 18245-18513/? D/NativeCrypto: doing handshake -- ret=-1
02-20 10:32:09.610 18245-18513/? D/NativeCrypto: ssl=0x68db8ff0 NativeCrypto_SSL_do_handshake ret=-1 errno=11 sslError=2 timeout_millis=15000
02-20 10:32:09.650 18245-18513/? D/NativeCrypto: doing handshake ++
02-20 10:32:09.650 18245-18513/? D/NativeCrypto: ssl=0x68db8ff0 info_callback where=0x4004 ret=552
02-20 10:32:09.650 18245-18513/? D/NativeCrypto: ssl=0x68db8ff0 SSL3 alert read:F:HF fatal handshake failure
02-20 10:32:09.650 18245-18513/? D/NativeCrypto: ssl=0x68db8ff0 info_callback ignored
02-20 10:32:09.650 18245-18513/? D/OpenSSLLib: OpensslErr:Module:20(119:1040); file:external/openssl/ssl/s23_clnt.c ;Line:741;Function:ssl23_get_server_hello
02-20 10:32:09.650 18245-18513/? D/NativeCrypto: ssl=0x68db8ff0 info_callback where=0x1002 ret=-1
02-20 10:32:09.650 18245-18513/? D/NativeCrypto: ssl=0x68db8ff0 SSL_connect:error exit in 23RSHA SSLv2/v3 read server hello A
02-20 10:32:09.650 18245-18513/? D/NativeCrypto: ssl=0x68db8ff0 info_callback ignored
02-20 10:32:09.650 18245-18513/? D/NativeCrypto: doing handshake -- ret=-1
02-20 10:32:09.650 18245-18513/? D/NativeCrypto: ssl=0x68db8ff0 NativeCrypto_SSL_do_handshake ret=-1 errno=0 sslError=1 timeout_millis=15000
02-20 10:32:09.650 18245-18513/? E/NativeCrypto: Unknown error during handshake
02-20 10:32:09.651 18245-18513/? D/NativeCrypto: ssl=0x68db8ff0 NativeCrypto_SSL_do_handshake unclean error => 0
02-20 10:32:09.651 18245-18513/? D/NativeCrypto: ssl=0x68db8ff0 NativeCrypto_SSL_interrupt
02-20 10:32:09.651 18245-18513/? D/NativeCrypto: sslNotify, appData=0x6d9c3c38 ret=1
02-20 10:32:09.651 18245-18513/? D/NativeCrypto: sslNotify, appData=0x6d9c3c38 ret=1
02-20 10:32:09.651 18245-18513/? I/System.out: [CDS]close[43926]
02-20 10:32:09.652 18245-18513/? I/System.out: close [socket][/0.0.0.0:43926]
02-20 10:32:09.652 18245-18513/? D/NativeCrypto: ssl=0x0 NativeCrypto_SSL_interrupt
02-20 10:32:09.653 18245-18513/? D/dalvikvm: threadid=51: exiting
02-20 10:32:09.654 18245-18513/? D/dalvikvm: threadid=51: bye!
02-20 10:32:09.657 18245-18310/? I/ReactNativeJS: 'downloadError:', { filePath:
{ [Error: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x68db8ff0: Failure in SSL library, usually a protocol error
error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:741 0x5eed16fd:0x00000000)] framesToPop: 1, code: 'EUNSPECIFIED' },
exception: undefined }
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.