当前位置:网站首页>Can JDBC based on openjdk connect to MySQL?
Can JDBC based on openjdk connect to MySQL?
2022-07-01 00:35:00 【hncscwc】
be familiar with ranger We should know ,ranger The server stores the policy information of service authentication in mysql in .
In the use of oracle jdk In the process of , There has been no problem ,ranger Can correctly from mysql Read and store data . However, when switching to openjdk after , There is ranger Startup cannot connect to mysql The phenomenon of , The following error messages can be seen from the log :
SQLException: SQL state: 08S01 com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
Through some source code analysis and online search of similar error information , The final positioning is :openjdk 1.8.0_291 Start , It is disabled by default tls1.0 and 1.1 edition , Lead to jdbc And mysql The connection to could not be established correctly , To report a mistake :
detailed release Poke it here :https://www.java.com/en/download/helprelease_changes.html
contrast oracle jdk Version of ,jdbc Connecting There is no manual designation useSSL=false When , The connection is still established using tls The way , And by default 1.1 Version .
Use openjdk after , Because disabled tls1.1, Unable to send correctly client hello, Therefore, the connection cannot be established .
The solution is simple :
One way is to jdbc Specifies not to use ssl, That is, add parameters useSSL=false, This is a common solution .
But one thing , Because the connection interaction process is not encrypted , Safety cannot be guaranteed ( Usually mysql All on the intranet , Interact with platform services , The network environment itself is relatively safe , Therefore, there is not much risk without encryption )
Another way is to jdbc The use of tls1.2 Version establishes a connection with mysql Interact . That is, add parameters enabledTLSProtocols=TLSV1.2.
and mysql By default, it also supports tls1.0/1.1/1.2, So there will be no problem .
Appoint tls1.2 after , The packet capture for establishing connection interaction is shown in the following figure :
To sum up , An error log for connection exceptions , Most of the solutions that can be found on the Internet are the first , In fact, manually specify the use of tls1.2 It's OK, too , The conclusion of this article is to check the leak and fill the vacancy .
Okay , That's all for this article , Originality is not easy. , give the thumbs-up , Looking at , Sharing is the best support , thank you ~
in addition , Two menus are arranged under the official account
One is the addition of classified historical articles , The current is hdfs、yarn、ranger、rabbitmq series , More articles will follow ; Another is the addition of personal wechat , There are some mistakes in the article , What is lacking , You can add me to wechat communication , Of course, it is not limited to the problem of the article , Other technical issues can also be exchanged .
This article is from WeChat official account. - hncscwc(gh_383bc7486c1a).
If there is any infringement , Please contact the [email protected] Delete .
Participation of this paper “OSC Source creation plan ”, You are welcome to join us , share .
边栏推荐
- Oracle-表的创建与管理
- IBL预计算的疑问终于解开了
- LVM snapshot: preparation of backup based on LVM snapshot
- 20220215 misc buctf easycap Wireshark tracks TCP flow hidden key (use of WinHex tool)
- The college entrance examination in 2022 is over. Does anyone really think programmers don't need to study after work?
- Design e-commerce seckill system
- 2022-2028 global 3D printing ASA consumables industry research and trend analysis report
- Deployment of mini version message queue based on redis6.0
- From January 11, 2007 to January 11, 2022, I have been in SAP Chengdu Research Institute for 15 years
- ABAQUS 2022 software installation package and installation tutorial
猜你喜欢
VR panorama adds contrast function to make the display of differentiation effect more intuitive!
ABAQUS 2022 latest edition - perfect realistic simulation solution
Pytorch auto derivation
Oracle-数据完整性
第53章 从业务逻辑实现角度整体性理解程序
【日常记录】——对BigDecimal除法运算时遇到的Bug
Docsify building a personal minimalist knowledge warehouse
SSM integration process (integration configuration, function module development, interface test)
20220216 misc buuctf another world WinHex, ASCII conversion flag zip file extraction and repair if you give me three days of brightness zip to rar, Morse code waveform conversion mysterious tornado br
Makefile notes (Yiwen Institute makefile)
随机推荐
NATs cluster deployment
Mysql database query optimization
File reading and writing for rust file system processing - rust Practice Guide
Is it safe to buy funds on the compass?
Unit test concept and purpose
CentOS 6.3 x64 PHP 5.2.6 扩展安装OpenSSL出错的解决方法
Examples of topological sequences
深度学习的历史
2022-06-30:以下golang代码输出什么?A:0;B:2;C:运行错误。 package main import “fmt“ func main()
On the application of cluster analysis in work
Why should VR panoramic shooting join us? Leverage resources to achieve win-win results
Combining online and offline, VR panorama is a good way to transform furniture online!
Red hat will apply container load server on project atomic
20220215 CTF misc buuctf the world in the mirror the use of stegsolve tool data extract
NE555波形发生器手把手教程之NE555内部结构(一)
The difference between union and union all in MySQL
什么是产品思维
ABAQUS 2022 software installation package and installation tutorial
When we look at the industrial Internet, we always look at it from the opposite of the consumer Internet
Confirm() method of window