linux - command - remote link

Access remote services http://blog.csdn.net/xifeijian/article/details/9399121
    

 HTTP

1. Get request
                curl " http://www.baidu.com " If the URL here points to a file or a picture, it can be downloaded directly to the local
                curl -i " http://www.baidu.com " display All information
                curl -l " http://www.baidu.com " only displays header information
                curl -v " http://www.baidu.com " shows the whole process analysis of get request

                wget " http://www.baidu.com " also works

 2、post请求
                curl -d "param1=value1¶m2=value2" "http://www.baidu.com"  

3. doc-linux general
               telnet ip port telnet is a remote login, mostly used in LINUX and UNIX systems, go to another remote computer to operate
               telnet 122.100.10.10 443
  
               ping ip ping mainly detects whether the network is bad and smooth
               ping 122.100.10.00

HTTPS

4. If the server requires client authentication, the pfx certificate needs to be converted into pem format

openssl pkcs12 -clcerts -nokeys -in cert.pfx -out client.pem #The public key of the client's personal certificate  

openssl pkcs12 -nocerts -nodes -in cert.pfx -out key.pem #The private key of the client's personal certificate

It can also be converted to a file in which the public key and private key are combined into one

openssl pkcs12 -in cert.pfx -out all.pem -nodes #The client public key and private key are stored together in all.pem

 

execute curl command

1. Use client.pem+key.pem

curl -k --cert client.pem --key key.pem https://www.xxxx.com

 

2. Use all.pem

curl -k --cert all.pem https://www.xxxx.com

 

Using -k, does not check the server's certificate, so you don't have to care about the export of the server's certificate.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326777160&siteId=291194637