0

I created a certificate using this:

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

Then I run:

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.

Update 1: Latest update:

I combined cert + private key to create a server.pem file and now I get this error:

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

I am on ubuntu 16.04 What is wrong I am doing ?

  • does the key have a password? – Tux_DEV_NULL Jan 19 '18 at 11:57
  • No. I just used above mentioned command for cert generation and gave common name. – Roshan Mehta Jan 19 '18 at 12:01
  • 1
    You do know that the -E option to curl is used to supply a client certificate? The certificate you've just generated (unless you've modified your openssl.cnf file) is a CA certificate. Also, curl expects it as a PKCS#12 file or a combined PEM file. To supply them independently, use the --cert and --key options. – garethTheRed Jan 19 '18 at 13:49
  • Updated the question, any idea ? – Roshan Mehta Jan 19 '18 at 19:14
  • Where do you say an error in latest example? The TLS part works, you are just hitting a non existing page. – Patrick Mevzek Jan 20 '18 at 22:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.