AIX Open Source

AIX Open Source

Share your experiences and connect with fellow developers to discover how to build and manage open source software for the AIX operating system

 View Only
  • 1.  CURL and self-signed cert problems

    Posted Mon October 07, 2024 08:29 AM

    Hi, 

    Today after patching AIX 7.2 to 7200-05-08, curl stopped working due to the lack of ssl lib 0.9.8.

    I updated curl and all its dependencies and curl is failing due to some issue with self-signed certificate.

    I downloaded the certificate from the server and put it in /var/ssl/certs, created the link correctly and now I get the error saying that the certificate subject name does not match target hostname.

    host: /root > curl https://host:11080
    curl: (60) SSL: certificate subject name 'CN' does not match target hostname 'host'
    More details here: https://curl.se/docs/sslcerts.html

    curl failed to verify the legitimacy of the server and therefore could not
    establish a secure connection to it. To learn more about this situation and
    how to fix it, please visit the webpage mentioned above.

    Is there any way of fixing this besides using -k or --insecure option with curl?

    Am I missing something else here?

    I downloaded the certificate using curl and openssl, both gave the same result.

    Commands used:

    curl --head --insecure https://host:11080 -w "%{certs}" -o /dev/null > /tmp/cacert.pem

    echo quit | openssl s_client -showcerts -servername host -connect host:11080 > /tmp/cacert.pem

    openssl s_client -showcerts -servername host -connect host:11080 < /dev/null | sed -n -e '/BEGIN\ CERTIFICATE/,/END\ CERTIFICATE/ p' > /tmp/server.pem

    All options give me the same result, saying that the subject name 'CN' does not match target hostname 'host'.

    Thanks in advance.



    ------------------------------
    Vinicius Trivinho
    ------------------------------


  • 2.  RE: CURL and self-signed cert problems

    Posted Tue October 08, 2024 11:14 AM

    this is hardly a curl or aix/openssl problem...The error suggests that the hostname in the the URL does not match match the common name in the certificate.



    ------------------------------
    I regret starting this entire conversation
    ------------------------------



  • 3.  RE: CURL and self-signed cert problems

    Posted Thu October 10, 2024 04:13 AM

    Thank you for replying.

    After a lot of research and try outs, I can conclude that nothing is wrong with curl or AIX, indeed, the certificate is the problem in this case. 

    Regards.



    ------------------------------
    Vinicius Trivinho
    ------------------------------