简体   繁体   English

cURL 的 SSL 证书问题 - sslcerts

[英]SSL certificate problem with cURL - sslcerts

I am trying establish communication between my Linux server (Debian GNU/Linux 10 buster) and a microservice located in another server.我正在尝试在我的 Linux 服务器(Debian GNU/Linux 10 buster)和位于另一台服务器中的微服务之间建立通信。 Telnet is working fine, but when I try to execute a curl, I get this error: Telnet 工作正常,但是当我尝试执行 curl 时,出现此错误:

$ curl "https://url.com.br/path"

curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.haxx.se/docs/sslcerts.html curl:(60)SSL证书问题:无法获取本地颁发者证书更多详细信息: https ://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. curl 无法验证服务器的合法性,因此无法建立与它的安全连接。 To learn more about this situation and how to fix it, please visit the web page mentioned above.要了解有关此情况以及如何解决此问题的更多信息,请访问上述网页。

I also have 2 .cer but I am not sure what I should do我也有 2 .cer 但我不确定我应该做什么

EDIT:编辑:

Tried to execute with -kv as @kashif suggested and here is the output:尝试按照@kashif 的建议使用 -kv 执行,这是输出:

* Expire in 0 ms for 6 (transfer 0x556613046fb0)
* Expire in 1 ms for 1 (transfer 0x556613046fb0)
* Expire in 0 ms for 1 (transfer 0x556613046fb0)
* Expire in 1 ms for 1 (transfer 0x556613046fb0)
* Expire in 0 ms for 1 (transfer 0x556613046fb0)
* Expire in 0 ms for 1 (transfer 0x556613046fb0)
* Expire in 1 ms for 1 (transfer 0x556613046fb0)
* Expire in 0 ms for 1 (transfer 0x556613046fb0)
* Expire in 0 ms for 1 (transfer 0x556613046fb0)
* Expire in 1 ms for 1 (transfer 0x556613046fb0)
* Expire in 0 ms for 1 (transfer 0x556613046fb0)
* Expire in 0 ms for 1 (transfer 0x556613046fb0)
* Expire in 1 ms for 1 (transfer 0x556613046fb0)
* Expire in 0 ms for 1 (transfer 0x556613046fb0)
* Expire in 0 ms for 1 (transfer 0x556613046fb0)
* Expire in 1 ms for 1 (transfer 0x556613046fb0)
* Expire in 0 ms for 1 (transfer 0x556613046fb0)
* Expire in 0 ms for 1 (transfer 0x556613046fb0)
* Expire in 1 ms for 1 (transfer 0x556613046fb0)
* Expire in 0 ms for 1 (transfer 0x556613046fb0)
* Expire in 0 ms for 1 (transfer 0x556613046fb0)
* Expire in 1 ms for 1 (transfer 0x556613046fb0)
* Expire in 0 ms for 1 (transfer 0x556613046fb0)
* Expire in 0 ms for 1 (transfer 0x556613046fb0)
* Expire in 1 ms for 1 (transfer 0x556613046fb0)
* Expire in 0 ms for 1 (transfer 0x556613046fb0)
* Expire in 0 ms for 1 (transfer 0x556613046fb0)
* Expire in 1 ms for 1 (transfer 0x556613046fb0)
* Expire in 0 ms for 1 (transfer 0x556613046fb0)
* Expire in 0 ms for 1 (transfer 0x556613046fb0)
* Expire in 1 ms for 1 (transfer 0x556613046fb0)
* Expire in 0 ms for 1 (transfer 0x556613046fb0)
* Expire in 0 ms for 1 (transfer 0x556613046fb0)
* Expire in 0 ms for 1 (transfer 0x556613046fb0)
*   Trying IP...
* TCP_NODELAY set
* Expire in 200 ms for 4 (transfer 0x556613046fb0)
* Connected to url.com.br (IP) port 443 (#0)
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: none   CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server accepted to use http/1.1
* Server certificate:
*  subject: C=BR; ST=SP; L=S㯠Paulo; O=EMPRESA; OU=SIT; CN=URL
*  start date: Jun 22 19:02:03 2021 GMT
*  expire date: Jun 21 19:02:03 2024 GMT
*  issuer: DC=br; DC=com; DC=EMPRESA; CN=EMPRESA Subordinate CA - Novo
*  SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
> GET /PATH HTTP/1.1
> Host: URL
> User-Agent: curl/7.64.0
> Accept: */*
> 
* TLSv1.2 (IN), TLS handshake, Hello request (0):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Request CERT (13):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Certificate (11):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* old SSL session ID is stale, removing < HTTP/1.1 404 Not Found < Content-Type: text/html < Server: Microsoft-IIS/10.0 < Date: Fri, 18 Mar 2022 14:01:48 GMT < Content-Length: 1245 <  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/> <title>404 - File or directory not found.</title> <style type="text/css"> <!-- body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;} fieldset{padding:0 15px 10px 15px;}  h1{font-size:2.4em;margin:0;color:#FFF;} h2{font-size:1.7em;margin:0;color:#CC0000;}  h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;} 
#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF; background-color:#555555;}
#content{margin:0 0 0 2%;position:relative;} .content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
--> </style> </head> <body> <div id="header"><h1>Server Error</h1></div> <div id="content">  <div class="content-container"><fieldset>   <h2>404 - File or directory not found.</h2>   <h3>The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.</h3>  </fieldset></div> </div> </body> </html>
* Connection #0 to host URL left intact

Try first with no certificate check(k) and in verbose mode(v).首先尝试不进行证书检查(k)和详细模式(v)。

curl -kv url : port curl -kv url端口

curl -kv "https://url.com.br/path" curl -kv "https://url.com.br/path"

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 curl:(60) SSL 证书问题:无法获取本地颁发者证书,了解更多详情:https://curl.haxx.se/docs/sslcerts.html - curl: (60) SSL certificate problem: unable to get local issuer certificate for More details here: https://curl.haxx.se/docs/sslcerts.html Nginx: curl: (60) SSL 证书问题:无法获得本地颁发者证书 - Nginx: curl: (60) SSL certificate problem: unable to get local issuer certificate 每当我使用 curl 并收到错误 60(SSL 证书问题)时,它还会向我显示一大堆文本。 如何隐藏它? - Whenever I use curl and get error 60 (SSL certificate problem) it also shows me big wall of text. How to hide it? vagrant up 命令 SSL 证书问题 - vagrant up command SSL certificate problem 问题 curl: (35) error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version - Problem curl: (35) error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version 无法创建SSL证书 - Trouble Creating SSL Certificate 我的ssl证书不受信任 - My ssl certificate is not trusted https(SSL)的卷曲命令 - Curl command for https ( SSL ) 在生产中运行 typeense 服务器时出现问题,SSL:没有替代证书主题名称与目标主机名“api.example.com”匹配 - Problem while running typesense server in production, SSL: no alternative certificate subject name matches target host name 'api.example.com' pip install:ssl证书问题 - pip install : issue with the ssl certificate
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM