webmagic爬取https网站,报错javax.net.ssl.SSLHandshakeException: Received fatal alert: protocol_version

javax.net.ssl.SSLException: Received fatal alert: protocol_version问题解决 完整报错如下: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet successfully received from the server was 122 milliseconds ago. The last packet sent successfully to the server was 119 milliseconds ago. at s 阅读详情

目前webmagic最新版是0.7.3版本,在爬取只支持TLS1.2的https站点会报错,作者说会在0.7.4版本发布修复错误,但是等了3年了都没等到0.7.4版本的发布.

javax.net.ssl.SSLHandshakeException: Received fatal alert: protocol_version
	at sun.security.ssl.Alert.createSSLException(Alert.java:131)
	at sun.security.ssl.Alert.createSSLException(Alert.java:117)
	at sun.security.ssl.TransportContext.fatal(TransportContext.java:314)
	at sun.security.ssl.Alert$AlertConsumer.consume(Alert.java:293)
	at sun.security.ssl.TransportContext.dispatch(TransportContext.java:187)
	at sun.security.ssl.SSLTransport.decode(SSLTransport.java:154)
	at sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1198)
	at sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1107)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:400)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:372)
	at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:436)
	at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:384)
	at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
	at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376)
	at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
	at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
	at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
	at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
	at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
	at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
	at us.codecraft.webmagic.downloader.HttpClientDownloader.download(HttpClientDownloader.java:85)
	at us.codecraft.webmagic.Spider.processRequest(Spider.java:404)
	at us.codecraft.webmagic.Spider.access$000(Spider.java:61)
	at us.codecraft.webmagic.Spider$1.run(Spider.java:320)
	at us.codecraft.webmagic.thread.CountableThreadPool$1.run(CountableThreadPool.java:74)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

目前的解决办法是:临时适配方式,修改HttpClientGenerator中的buildSSLConnectionSocketFactory方法,重写自己实现的HttpClientDownloader,并设置到Spider中。修改内容如下:

return new SSLConnectionSocketFactory(createIgnoreVerifySSL(), new String[]{"SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2"},
                    null,
                    new DefaultHostnameVerifier())

目前我已经把源码修改好了,并编译为jar包,有被同样问题困扰的朋友可以直接下载使用.

webmagic-core-0.7.3.jar

提取码:webm

jar包使用方法:将下载好的 jar包,放在你的maven仓库的us\codecraft\webmagic-core\0.7.3路径下,替换原有jar包即可解决问题.

 

Unrecognized SSL message, plaintext connection?https请求遇到异常分析 前段时间开发了一个https请求客户端 在线上联调一个https双向认证接口的时候 请求抛出如下异常 javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?具体的客户端的实现方式可移步看这篇文章 http://blog.csdn.net/dtlscsl/article/details/5011822 阅读详情

相关推荐

用 ABAP CDS External Entity 把外部数据接入 S/4HANA:语法拆解、运行时绑定与 Clean Core 实战

摘要: ABAP CDS External Entity 为企业异构数据访问提供轻量级解决方案,通过 SAP HANA Smart Data Access 实现数据联邦,避免数据复制与核心系统污染。其核心能力在于将外部数据库对象映射为可查询的 ABAP SQL 实体,支持字段级名称映射与类型转换。技术实现分为动态(运行时绑定)和静态(设计期绑定)两种模式,前者灵活适配多环境,后者支持更复杂的CDS模型组合。典型应用场景包括跨系统数据关联、实时报表查询等,同时遵循SAP Clean Core原则,将扩展数据保

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 6594

RestTemplate发起HTTPS请求Unsupported or unrecognized SSL message 报错解决

RestTemplate发起HTTPS请求Unsupported or unrecognized SSL message 报错解决

菜鸡的博客 1万+

【抖音】a_bogus参数逆向分析

点击——展开xxx条回复﹀就会出现。可以看到这个栈是有请求相关的数据的。所以就是在bdms.js里面生成的。

qq_44990881的博客 3000

Unsupported or unrecognized SSL message

public class URLDemo1 { public static void main(String[] args) throws Exception { //下载地址 URL url = new URL("https://localhost:8080/fanbin/screct.txt"); //连接到这个资源 HTTP HttpsURLConnection urlConnection =(HttpsURLConnectio

qq_39164062的博客 1万+

Ubuntu20.04 高效安装企业微信的完整指南

本文提供了在Ubuntu20.04系统上高效安装企业微信的完整指南,详细介绍了通过Deepin-wine环境运行Windows版企业微信的步骤和优化技巧。内容包括系统环境检查、依赖安装、企业微信包的获取与安装、首次运行配置及常见问题解决方案,帮助开发者在Ubuntu系统中流畅使用企业微信进行办公通讯。

weixin_42568801的博客 351

小曾WRF自学日记(3)渐入佳境 ——WRF实例-数据下载与WPS前处理

ww

weixin_46297571的博客 1480

Java报错Unsupported or unrecognized SSL message解决方法

客户端和服务器使用的 SSL/TLS 协议版本不兼容。例如,客户端使用 TLS 1.2,而服务器只支持 TLS 1.0。这种情况下,两者无法建立安全连接。url: jdbc:mysql://127.0.0.1:3306/数据库名称?禁用 SSL/TLS 加密连接,配置文件中数据库连接url属性加入。username: 用户名。password: 密码。

A2207728335的博客 7464

[附源码]计算机毕业设计JAVA网上花店系统

附源码]计算机毕业设计JAVA网上花店系统项目运行环境配置:(Webstorm也行)+ Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)。项目技术:等等组成,B/S模式 + Maven管理等等。环境需要1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;3.tomcat。

ssm毕设程序设计 2444

EUREKA Client 无法连接注册中心问题解决方案【连接被拒绝、不支持SSL协议消息、不能向任意已知的服务器发送请求】

版本:HOXTON.SR8 主要报错信息如下: //无法连接注册中心 DiscoveryClient_CLIENT1/host.docker.internal:client1:8089 - registration failed Cannot execute request on any known server com.netflix.discovery.DiscoveryClient : DiscoveryClient_CLIENT1/host.docker.internal:client

你好师姐! 1万+

学Simulink--基于风力发电系统的场景实例:海上风电场在复杂海况下的动态响应仿真

本实例将创建一个针对海上风电场在复杂海况下的动态响应模型。该模型不仅考虑了不同风速条件的影响,还引入了波浪和水流对风机塔架及基础结构的影响。通过仿真验证系统的有效性,并探索最佳控制参数设置以提高整体性能和稳定性。本教程展示了如何在Simulink中实现一个海上风电场在复杂海况下的动态响应仿真模型,并分析其性能。通过这种方式,我们不仅可以验证所提出的技术手段在提高海上风电场稳定性和效率方面的有效性,还能进一步探索优化参数以适应特定的应用场景。

xiaoheshang_123的博客 167

uniApp微信小程序:利用live-pusher人脸活体检测功能+完整示例代码,uniapp使用live-pusher直播推流组件实现人脸验证-活体检测,检测人脸中的动作包括眨眼、张嘴、左右摇头动作

UniApp 使用 live-pusher 实现人脸活体检测(附完整源码)uniapp开发微信小程序人脸检测活体检测,在uni-app的微信小程序项目中使用live-pusher实现人脸识别,uniapp使用live-pusher实现模拟人脸识别效果,张张嘴、眨眨眼、向左摇头、向右摇头等动作,免费使用人脸活体检测的插件方案,uniapp小程序怎么免费使用人脸活体,直播推流,UNIAPP微信小程序使用live-pusher实现人脸识别(拍照)功能,在uni-app项目中实现人脸识别,既使用uni-app中的l

✅ 精选推荐文章 3013

javax.net.ssl.SSLException: Unsupported or unrecognized SSL message

jmeter请求时报javax.net.ssl.SSLException: Unsupported or unrecognized SSL message 如何解决? 1、报错截图如下 2、解决方案

niuwenying_123的博客 3万+

EPLAN中2D安装板的绘制方法示例

EPLAN中2D安装板的绘制方法示例

Robot_PLC_HMI_Automation 3215

jenkins 配置阿里云企业邮箱发送邮件测试,各种报错终于解决

步骤二:邮箱扩展配置 Extended E-mail Notification(这个只要能发邮件了可以自行配置)不配置不影响发送邮件测试。SMTP服务器:smtp.qiye.aliyun.com smtp.mxhichina.com。看了网上很多文档,按照配置报各种错误,于是记录该文档,希望能帮助有缘人。注意点:阿里云邮箱账号安全设置中的:三方客户端安全密码一定要关闭。这里开启邮箱账号密码就登录不了,出现上面的错误。步骤一:配置系统管理员邮件地址。步骤三:邮件通知(关键)

dengqiquan的博客 2294

【PCIe 总线及设备入门学习专栏 6.1 -- PCIe MCTP】

MCTP 是由 DMTF(Distributed Management Task Force)定义的协议,用于提供设备和主机间基于不同传输层(如 PCIe、I²C、USB 等)的管理消息通信能力。在 PCIe 环境下,MCTP 消息作为的一种特殊形式传输,并被赋予唯一的 VDM Code 值0000b,以区别于其他 VDM。MCTP 在 PCIe 环境中作为一种基于 Type 1 VDM 的管理通信协议,提供了设备与主机之间的灵活数据传输能力。

CodingCos的博客 2127

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

使用Burp发送请求,左下角显示Unsupported or unrecognized SSL message

这个问题很简单,那就是源网址使用http协议。而不是https协议。

m0_72678953的博客 2408

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

JMeter接口请求返回值javax.net.ssl.SSLException: Unsupported or unrecognized SSL message

JMeter接口请求返回值javax.net.ssl.SSLException: Unsupported or unrecognized SSL message

春暖鱼跳 2688

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

https请求报错:javax.net.ssl.SSLHandshakeException:Received fatal alert: unrecognized_name 的解决过程

https请求报错:javax.net.ssl.SSLHandshakeException:Received fatal alert: unrecognized_name 的解决过程

qq_39201012的博客 5224

javax.net.ssl.SSLException: Received fatal alert: protocol_version解决

javax.net.ssl.SSLException解决方法

心寒的博客 2万+

Burpsuite Unsupported or unrecognized SSL message问题解决方案

但是抓百度这种https网站没问题 抓http网站默认解析成https导致报错。在此处关闭掉安全连接即可。

qq_52610024的博客 2846

使用hutool的MailUtil遇到的一些报错

465的端口好像被占用了,改用了587,我使用的是QQ邮箱,可以参考邮箱给出的文档。sslEnable = false <-设置为false。服务配置出错了,参考上述截图修改一下mail的配置。在mail.setting中的设置。#使用SSL安全连接。

qq_49090747的博客 2684

已解决SSLException: Unrecognized SSL message, plaintext connection异常的正确解决方法,亲测有效!!!

已解决SSLException: Unrecognized SSL message, plaintext connection异常的正确解决方法,亲测有效!!!

小明的Java问道之路 2万+

javamail发送qq邮箱失败案例分析

qq邮箱邮件发送失败案例分析

程序员码小跳 7791

【Java异常】Unrecognized SSL message, plaintext connection?https请求遇到异常分析

本文目录 一、错误描述 二、错误原因 三、解决方案 一、错误描述 前段时间开发了一个https请求客户端 在线上联调一个https双向认证接口的时候 请求抛出如下异常, 在使用 HttpClient 工具调用第三方 Http 接口时报错javax.net.ssl.SSLException:Unrecognized SSL message,plaintext connection? 这个错误意思是说,无法识别 SSL 信息,明文连接? 看这个意思是说在使用 https 协议访问网络资源时无.

No8g攻城狮的博客 7万+
上一篇: 微信公众号开发,redirect_uri域名与后台配置不一致,错误码:10003
下一篇: Selenium高级:java+selenium设置禁止图片加载,爬虫优化
彭大勃
博客等级 码龄9年 0粉丝 8原创
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值