You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exception in thread "main" com.arronlong.httpclientutil.exception.HttpProcessException: javax.net.ssl.SSLException: Received fatal alert: protocol_version
at com.arronlong.httpclientutil.HttpClientUtil.execute(HttpClientUtil.java:462)
at com.arronlong.httpclientutil.HttpClientUtil.send(HttpClientUtil.java:377)
at com.arronlong.httpclientutil.HttpClientUtil.post(HttpClientUtil.java:128)
at com.github.binarywang.demo.wx.mp.utils.HttpRequestUtilsTest.main(HttpRequestUtilsTest.java:60)
Caused by: javax.net.ssl.SSLException: Received fatal alert: protocol_version
Exception in thread "main" com.arronlong.httpclientutil.exception.HttpProcessException: javax.net.ssl.SSLException: Received fatal alert: protocol_version
at com.arronlong.httpclientutil.HttpClientUtil.execute(HttpClientUtil.java:462)
at com.arronlong.httpclientutil.HttpClientUtil.send(HttpClientUtil.java:377)
at com.arronlong.httpclientutil.HttpClientUtil.post(HttpClientUtil.java:128)
at com.github.binarywang.demo.wx.mp.utils.HttpRequestUtilsTest.main(HttpRequestUtilsTest.java:60)
Caused by: javax.net.ssl.SSLException: Received fatal alert: protocol_version
//最简单的使用:
HCB hcb = HCB.custom()
//.timeout(1000) //超时
.pool(100, 10) //启用连接池,每个路由最大创建10个链接,总连接数限制为100个
.sslpv("TLSv1.2") //可设置ssl版本号,默认SSLv3,用于ssl,也可以调用sslpv("TLSv1.2")
.ssl() //https,支持自定义ssl证书路径和密码,ssl(String keyStorePath, String keyStorepass)
.retry(5) //重试5次
;
// .map(map) //设置请求参数,没有则无需设置
.encoding("utf-8") //设置请求和返回编码,默认就是Charset.defaultCharset()
.client(client) //如果只是简单使用,无需设置,会自动获取默认的一个client对象
//.inenc("utf-8") //设置请求编码,如果请求返回一直,不需要再单独设置
//.inenc("utf-8") //设置返回编码,如果请求返回一直,不需要再单独设置
.json("{\n" +
" "current_openid": "199",\n" +
" "gzhid": "1"\n" +
"\n" +
"}") //json方式请求的话,就不用设置map方法,当然二者可以共用。
//.context(HttpCookies.custom().getContext()) //设置cookie,用于完成携带cookie的操作
//.out(new FileOutputStream("保存地址")) //下载的话,设置这个方法,否则不要设置
//.files(new String[]{"d:/1.txt","d:/2.txt"}) //上传的话,传递文件路径,一般还需map配置,设置服务器保存路径
;
The text was updated successfully, but these errors were encountered: