cinergi has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

I'm trying to debug the following error in a perl script that manipulates X509 certificates.

RSA.xs:194: OpenSSL error: no start line

My research suggests this is usually due to the certificate files not having the correct text encoding for the platform (UTF-8 for Windows in my case). However, I can read the certificates just fine using "openssl x509 -text -inform PEM -in <certfile>" from the command line, so this doesn't seem to be the case. What other causes does this error have?

In case it doesn't show, I'm a total perl newbie. Just trying to get a script running (I did not write it).

Thanks!

cinergi

  • Comment on RSA.xs:194: OpenSSL error: no start line

Replies are listed 'Best First'.
Re: RSA.xs:194: OpenSSL error: no start line
by daxim (Curate) on Oct 15, 2019 at 08:37 UTC
    You get much higher quality answers if you enable us to reproduce the problem (sscce, mcve). As the question stands now, only guessing is possible. Please edit it to add the relevant details.
    files not having the correct text encoding
    PEM files in text form are ASCII, that can't be the problem.
    just fine using "openssl
    The Perl code might not use the same library as the command-line tool, please verify.
    › openssl version › perl -mNet::SSLeay -E "say for Net::SSLeay->VERSION, sprintf q(%X), +Net::SSLeay::SSLeay"
    If the certificate is in actual use, https://github.com/noxxi/p5-ssl-tools can be helpful.

    What is the opinion of gnutls about the file?

    › certtool -i < somefile.pem
Re: RSA.xs:194: OpenSSL error: no start line
by Anonymous Monk on Oct 16, 2019 at 13:07 UTC
    Thanks, I have figured it out. It was a missing key in the certificate file. -cinergi