Closed vasilevalex closed 2 years ago
Hi @vasilevalex ,
I'm not getting an error when testing as mentioned above. Have you changed anything in tls_wolfssl's module Makefile?
Hi @rvlad-patrascu
Actually, yes, I changed Makefile to disable weak and unsecure cipher suites: --disable-idea
and -DNO_DES3 -DNO_DSA -DNO_MD4 -DNO_RC4 -UHAVE_NULL_CIPHER
. It worked as expected, just disabling all unsecure stuff, so I even didn't think about this.
Please don't close this, so I'll add information, what exactly breaks this cipher suite.
Hi @rvlad-patrascu
It does not matter, if these flags are used or not. The only thing, that breaks TLS is when configuration uses range of TLS versions. I.e. with method=TLSv1_2-
the issue is reproducible and with method=TLSv1_2
everything works just fine. Can you please look at this one more time?
Hi @vasilevalex,
Indeed using a method range this reproduces for me too (although I don't see this error on opensips side: ERROR:tls_wolfssl:_wolfssl_read: TLS read error: -313, received alert fatal error
).
What is strange is that if I actually send data on the connection with openssl s_client
(eg. cat ./sip_msg | openssl s_client
...) it works fine. This might even be an issue with wolfSSL implementation when providing a method range. I will look more into it.
Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.
Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.
Hello Everyone, We having troubles with RSA ciphers too
Mar 4 20:00:47 /usr/sbin/opensips[60230]: ================= start TLS pseudo variables ===============
Mar 4 20:00:47 /usr/sbin/opensips[60230]: $tls_version = 'TLSv1.2'
Mar 4 20:00:47 /usr/sbin/opensips[60230]: $tls_cipher_info = 'ECDHE-RSA-AES256-GCM-SHA384'
Mar 4 20:00:47 /usr/sbin/opensips[60230]: ERROR:tls_wolfssl:get_cert: failed to get certificate from SSL structure
Mar 4 20:00:47 /usr/sbin/opensips[60230]: $tls_peer_san_hostname = '<null>'
Mar 4 20:00:47 /usr/sbin/opensips[60230]: ERROR:tls_wolfssl:get_cert: failed to get certificate from SSL structure
Mar 4 20:00:47 /usr/sbin/opensips[60230]: $tls_peer_san_ip = '<null>'
Mar 4 20:00:47 /usr/sbin/opensips[60230]: ================= end TLS pseudo variables ===============
Mar 4 20:00:47 /usr/sbin/opensips[60230]: [REGISTER] Got expires timer inter => <null> customer transport => tls
Mar 4 20:00:47 /usr/sbin/opensips[60230]: ERROR:tls_wolfssl:_wolfssl_read: TLS connection to 47.24.94.64:58684 read failed
Mar 4 20:00:47 /usr/sbin/opensips[60230]: ERROR:tls_wolfssl:_wolfssl_read: TLS read error: -313, received alert fatal error
Mar 4 20:00:47 /usr/sbin/opensips[60230]: ERROR:proto_tls:tls_read_req: failed to read
In 2.4 was patch for wolfssl which include this
diff --git a/modules/tls_wolfssl/Makefile b/modules/tls_wolfssl/Makefile
index 342c14887..c8009d556 100644
--- a/modules/tls_wolfssl/Makefile
+++ b/modules/tls_wolfssl/Makefile
@@ -22,7 +22,7 @@ lib/lib/libwolfssl.a:
--enable-writedup --enable-tlsv10 --disable-shared --enable-static \
--disable-jni --disable-crl-monitor \
--prefix=$(MOD_DIR)/lib \
- --exec-prefix=$(MOD_DIR)/lib C_EXTRA_FLAGS="-fPIC" CFLAGS="-DWOLFSSL_STATIC_RSA -DWOLFSSL_USER_MUTEX"; \
+ --exec-prefix=$(MOD_DIR)/lib C_EXTRA_FLAGS="-fPIC" CFLAGS="-DWOLFSSL_STATIC_RSA"; \
Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.
in progress
Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.
in progress
Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.
in progress
Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.
Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.
in progress
@rvlad-patrascu Thanks! Works fine.
OpenSIPS version you are running
Describe the bug Connection can not be established when client uses cipher suite ECDHE-RSA-AES128-SHA256.
To Reproduce
openssl s_client -tls1_2 -cipher ECDHE-RSA-AES128-SHA256 -connect <opensips_hostname>:5061
139673257969472:error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac:ssl/record/ssl3_record.c:521
./client -A /etc/pki/tls/certs/ca-bundle.crt -l TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 -h <opensips_hostname> -p 5061
SSL_read reply error -312, error during decryption
Expected behavior Successful connection without errors.
Relevant System Logs
ERROR:tls_wolfssl:_wolfssl_read: TLS read error: -313, received alert fatal error
OS/environment information
Rocky Linux release 8.5 (Green Obsidian)
git
Additional context I have tested wolfssl independently. Wolfssl server from examples (build from tag v4.7.1r) works fine and accepts connections from both wolfssl client and openssl client: