Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have two questions regarding this.my $ua = LWP::UserAgent->new( ssl_opts => { #SSL_version => 'SSLv3', verify_hostname => 0, SSL_cert_file => "./cert.pem", SSL_cert_key => "./key.pem" } ); my $res = $ua->get($query);
1. Why is in documentation of IO::Socket::SSL that I can set SSL_version to SSLv3 and when I do so, I get error that this version is not supported?
2. In which format should the key be in? I tried following formats:
a) PEM format = other tools and openssl also works fine with this format so I guess the file is not modified in some weird way. b) DER format = I converted from PEM format with: openssl rsa -in key.pem -pubout -outform DER -out key.der .... converted with no errors. c) DER format = I converted from PEM format with: openssl pkcs8 -topk8 -inform PEM -outform DER -in key.pem -out key.der -nocrypt .... converted with no errors. d) I also tried format that is output of: openssl rsa -in key.pem -text > key1.pem
But every single one yields this error:DEBUG: .../IO/Socket/SSL.pm:2582: Failed to load key from file (no PEM or DER) SSL error: 19240: 1 - error:0D08303A:asn1 encoding routines:asn1_template_noexp_d2i:nested asn1 error SSL error: 19240: 2 - error:0D0680A8:asn1 encoding routines:asn1_check_tlen:wrong tag SSL error: 19240: 3 - error:0D07803A:asn1 encoding routines:asn1_item_embed_d2i:nested asn1 error SSL error: 19240: 4 - error:04093004:rsa routines:old_rsa_priv_decode:RSA lib SSL error: 19240: 5 - error:0D0680A8:asn1 encoding routines:asn1_check_tlen:wrong tag SSL error: 19240: 6 - error:0D07803A:asn1 encoding routines:asn1_item_embed_d2i:nested asn1 error SSL error: 19240: 7 - error:140B000D:SSL routines:SSL_CTX_use_PrivateKey_file:ASN1 lib DEBUG: .../IO/Socket/SSL.pm:2582: global error: Failed to load key from file (no PEM or DER) error:0D0680A8:asn1 encoding routines:asn1_check_tlen:wrong tag
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: LWP::UserAgent Client certificate authentication
by hippo (Archbishop) on Jun 28, 2018 at 08:31 UTC | |
|
Re: LWP::UserAgent Client certificate authentication
by Veltro (Hermit) on Jun 28, 2018 at 13:15 UTC | |
by hippo (Archbishop) on Jun 28, 2018 at 13:35 UTC | |
by Veltro (Hermit) on Jun 28, 2018 at 14:15 UTC | |
by hippo (Archbishop) on Jun 28, 2018 at 14:40 UTC | |
|
Re: LWP::UserAgent Client certificate authentication
by noxxi (Pilgrim) on Jun 29, 2018 at 20:28 UTC | |
|
Re: LWP::UserAgent Client certificate authentication
by Anonymous Monk on Jun 27, 2018 at 23:23 UTC |