centos8当中的openssl默认配置需要做调整,否则一些用了ssl的工具在访问旧服务器时会出现一些问题。
我遇到的情况是svn检出旧服务器上的项目时出现了异常(访问新服务器正常):
[root@localhost projects]# svn co https://serverip/svn/Linux/hmi hmi
svn: E170013: Unable to connect to a repository at URL 'https://serverip/svn/Linux/hmi'
svn: E120171: Error running context: An error occurred during SSL communication
出现这种情况是由于新版本的openssl与服务器上的ssl所用的协议不兼容导致的。
我们可以用以下命令来测试(svn服务器默认用的443的端口号):
[root@localhost projects]# openssl s_client -connect serverip:443
CONNECTED(00000004)
139911078549312:error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol:ssl/statem/statem_lib.c:1907:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 58 bytes and written 326 bytes
Verification: OK
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 0 (ok)
---
这里发现openssl默认选择的tls版本,服务器是不支持的,我们还可以加tls版本参数再来测试(我用的openssl可以支持-tls1_3 -tls1_2 -tls1_1 -tls1的版本,这些是通过命令openssl s_client -help得知的,可以都尝试下),以下是测试-tls1_2的情况:
[root@localhost projects]# openssl s_client -connect serverip:443 -tls1_2
CONNECTED(00000004)
140651559294784:error:1425F102:SSL routines:ssl_choose_cli