c++ - 关于libcurl ssl的问题
阿神
阿神 2017-04-17 14:50:07
0
2
596

问题:目前本地libcurl已经支持https的发送,但是有个问题,想在接口处去验证服务器是否支持https请求,这样外围模块只需要直接丢url到libcurl就行。请问libcurl有这么一个接口,可以判断服务端是否支持https请求。

说白了:就是客户端有没有一种方法,可以查询服务器是否支持https请求?

阿神
阿神

闭关修行中......

reply all(2)
大家讲道理

No special interface. You set up curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuf); and connect directly. If SSL is not supported. The error CURLE_SSL_CONNECT_ERROR will be returned, and the error cause will be in the error buffer.
The main thing is this, whether to use SSL is determined by the protocol of the URL, whether there is https or not. Because SSL can be set on different ports, this is also URL specified. So it all depends on how the URL is written. Curl just connects based on the URL.

迷茫

Check the API of libcurl and it should be there.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template