Tag Archives: curl

cURL error 35:error:140770FC:SSL routines:SSL_23_GET_SERVER_HELLO:unknown protocol

A problem occurred during the SSL/TLS handshake. You do need error buffering and reading messages there, because it hints at the problem. This can be a certificate (file format, path, permission), password, and so on.

Bug tip :cURL Error 35: Error :140770FC:SSL :SSL_23_GET_SERVER_HELLO: Unknown Protocol

Solutions:
1. Modify SSL version

Curl_setopt ($ch, CURLOPT_SSLVERSION, 3); // Set SSL version,1-3 switch

Curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, false); //
Do not check certificates

If this doesn’t work, see below

2. Modify the file permissions to 777
If this doesn’t work, see below
3. Remove the requested https://
Example: change https://www.360kan.com to www.360kan.com

Curl returns empty reply from server. Due to the processing of special characters, curl cannot be accessed and the browser can access it.

Use the browser for normal access.
When using curl access, either appear
Return Empty Reply from Server or display

Through a number of experiments and Windows under the curl comparison, found that the access path has & AMP; Character, resulting in truncation.
When you add double quotes, you can access it normally
Both curl “http://x.x.x.x:8080/wserver?r=x& s=x& ./”

Error 403 Forbidden when using WGet or curl

This error occurred because the server rejected the request using wget or curl. In order to prevent crawlers from consuming the server resources, the server selectively screened the request headers according to your request. Therefore, the Agent user-agent of wget and curl needs to be modified for camouflage.
 
I. Modify user-Agent of WGET
1. Temporarily change THE UA of WGET
Before wget, add the parameter -u , which means to set User Agent

wget www.google.com -U "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36"

What is User Agent and how to get it, please refer to the following blog. Of course, you can also use the above one directly.
What is the UserAgent and how to view the UserAgent using the browser
 
2. Permanently change THE UA of Wget
Modify the configuration file /etc/wgetrc to add the following line:

header = User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36

The above configuration will take effect for all users. If you only want the current user to take effect, you can add the above line to ~/.wgetrc. If this file is not available, you can create it manually.
 
2. Modify the user-Agent of curl
1. Temporary change to Curl’s UA
Use the following parameters:

curl https://www.google.com --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36"

 
2. Permanently change Curl’s UA
Modify the profile ~/.curlrc to add the following line:

–user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36

 
Reference:
1, https://www.linpx.com/p/on-an-interesting-play-wget-use.html
2, https://chaifeng.com/_curl_wget_user-agent/

WordPress download template, update error No working transports found solution

    error because PHP did not open curl. Windows open method as follows

    1. Put php.ini; 2. Extension = remove the semicolon in front of php_curl. DLL
    Libeay32.ll, ssleay32.dll, php_curl, libssh2.dll move PHP into Windows /system32, and then restart Apache server, problem solved note: many answers on the net are put libeay32.ll, ssleay32.dll, php_curl. DLL three files are enough, but I try to come down, but also need libssh2.dll

curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused

problem description: implement the sh -c "$(curl - fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" download ohmyzsh times wrong: curl: port 443 (7) Failed to connect to raw.githubusercontent.com: Connection refused

join process

Hinata% sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused

reason: this is not the connection timeout, nor the certificate problem, this is not to let the connection, indicating that

is qiang

solution: fan goes out and reexecutes the command

and how to get out, I'm using the (s)(s)+polipo, (s)(s) (s) tutorial and you can search again, polipo USES which I've written before, you can look at this Linux socks5 over HTTP