curl.error:(35,'读取 X.509 密钥或证书文件时出错')

curl.error:(35,'读取 X.509 密钥或证书文件时出错')

我使用以下命令创建了证书:

openssl req -x509 -nodes -newkey rsa:4096 -keyout server.key -out server.crt -days 365

然后我运行:

curl -l --tlsv1.2 -E server.crt -v https://test-as.sgx.trustedservices.intel.com:443/ 

*   Trying 52.0.37.241...
* Connected to test-as.sgx.trustedservices.intel.com (52.0.37.241) port 443 (#0)
* found 148 certificates in /etc/ssl/certs/ca-certificates.crt
* found 606 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* error reading X.509 key or certificate file: Error in parsing.
* Closing connection 0
curl: (35) error reading X.509 key or certificate file: Error in parsing.

更新1:最新更新:

我组合了证书和私钥来创建 server.pem 文件,现在出现此错误:

roshan@bolt:~/SGXcompliment/certificate/simplecert/IAS$ curl -l --tlsv1.2 -E server.pem -v https://test-as.sgx.trustedservices.intel.com:443/
*   Trying 52.0.37.241...
* Connected to test-as.sgx.trustedservices.intel.com (52.0.37.241) port 443 (#0)
* found 148 certificates in /etc/ssl/certs/ca-certificates.crt
* found 606 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256
*    server certificate verification OK
*    server certificate status verification SKIPPED
*    common name: test-as.sgx.trustedservices.intel.com (matched)
*    server certificate expiration date OK
*    server certificate activation date OK
*    certificate public key: RSA
*    certificate version: #3
*    subject: C=US,postalCode=95630,ST=CA,L=Folsom,street=FM1-110,street=1900 Prairie City Rd.,O=Intel Corporation,OU=Hosted by Intel Corporation,OU=Enterprise SSL Pro,CN=test-as.sgx.trustedservices.intel.com
*    start date: Mon, 28 Aug 2017 00:00:00 GMT
*    expire date: Wed, 28 Aug 2019 23:59:59 GMT
*    issuer: C=GB,ST=Greater Manchester,L=Salford,O=COMODO CA Limited,CN=COMODO RSA Organization Validation Secure Server CA
*    compression: NULL
* ALPN, server accepted to use http/1.1
> GET / HTTP/1.1
> Host: test-as.sgx.trustedservices.intel.com
> User-Agent: curl/7.47.0
> Accept: */*
> 
< HTTP/1.1 404 Not Found
< content-length: 0
< request-id: 960abc84bdc24e16a72b4f9f4d7dcc20
< date: Fri, 19 Jan 2018 19:23:59 GMT
< Connection: keep-alive
< 
* Connection #0 to host test-as.sgx.trustedservices.intel.com left intact

我在 ubuntu 16.04 上我做错了什么?

相关内容