Olá Daniel, tudo bem?<br><br>Quando a URL inicia com https, o LWP já faz uso do Crypt::SSLeay ou Net::SSL.<br>E as duas já estão instaladas, na verdade parece que o handshake é interrompido no finalzinho.<br><br>Fiz testes e mais testes, acho que minha saída é tentar implementar sem Lwp (gerar as requisições "na mão"), fazendo chamada ao Net::SSL na hora da criptografia, e ver onde o processo de handshake pára.<br>
<br>Grato, <br><br clear="all">--<br>Geovanny Junio<br>Consultor de Tecnologia<br>geovanny (at) <a href="http://eutsiv.com.br">eutsiv.com.br</a><br>+55 31 9422-8885<br>+55 31 3393-9132<br><a href="http://www.eutsiv.com.br">www.eutsiv.com.br</a><br>
<br>Este e-mail pode conter informação privilegiada e confidencial. Se você não é destinatário da<br>mensagem, por favor apague a mensagem e comunique-nos o fato de imediato.<br><br>This e-mail contains information that may be<br>
privileged and confidential. If you are not the intended recipient, please<br>delete the e-mail and notify us immediately.<br>
<br><br><div class="gmail_quote">2010/1/9 Daniel de Oliveira Mantovani <span dir="ltr"><<a href="mailto:daniel.oliveira.mantovani@gmail.com">daniel.oliveira.mantovani@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Olá, talvez você precise usar SSL.<br>
<br>
$cpan<br>
look LWP<br>
vim README.SSL<br>
"SSL SUPPORT<br>
-----------<br>
<br>
The libwww-perl package has support for using SSL/TLSv1 with its HTTP<br>
client and server classes. This support makes it possible to access<br>
https schemed URLs with LWP. Because of the problematic status of<br>
encryption software in general and certain encryption algorithms in<br>
particular, in several countries, libwww-perl package doesn't include<br>
SSL functionality out-of-the-box.<br>
<br>
Encryption support is obtained through the use of Crypt::SSLeay or<br>
IO::Socket::SSL, which can both be found from CPAN. While libwww-perl<br>
has "plug-and-play" support for both of these modules (as of v5.45),<br>
the recommended module to use is Crypt::SSLeay. In addition to<br>
bringing SSL support to the LWP package, IO::Socket::SSL can be used<br>
as an object oriented interface to SSL encrypted network sockets.<br>
<br>
There is yet another SSL interface for perl called Net::SSLeay. It has<br>
a more complete SSL interface and can be used for web client<br>
programming among other things but doesn't directly support LWP.<br>
<br>
The underlying SSL support in all of these modules is based on OpenSSL<br>
<<a href="http://www.openssl.org/" target="_blank">http://www.openssl.org/</a>> (formerly SSLeay). For WWW-server side SSL<br>
support (e.g. CGI/FCGI scripts) in Apache see <<a href="http://www.modssl.org/" target="_blank">http://www.modssl.org/</a>>."<br>
<br>
Da uma olhada:<br>
Crypt::SSLeay => <a href="http://search.cpan.org/%7Edland/Crypt-SSLeay-0.57/SSLeay.pm" target="_blank">http://search.cpan.org/~dland/Crypt-SSLeay-0.57/SSLeay.pm</a><br>
<br>
*Eu não sei se é esse o problema*<br>
<br>
2010/1/8 eutsiv :: Geovanny Junio <<a href="mailto:geovanny@eutsiv.com.br">geovanny@eutsiv.com.br</a>>:<br>
<div><div></div><div class="h5">> Olá companheiros(as), tudo bem?<br>
> Estou trabalhando em um módulo para a NFSe, mas estou com problemas no<br>
> acesso ao webservice,<br>
> segue o código:<br>
> $ENV{HTTPS_DEBUG} = 1;<br>
> # Client PKCS12 cert support<br>
> $ENV{HTTPS_PKCS12_FILE} = 'mycert.pfx';<br>
> $ENV{HTTPS_PKCS12_PASSWORD} = 'mypass'';<br>
> my $userAgent = LWP::UserAgent->new();<br>
> my $request = HTTP::Request->new(POST =><br>
> '<a href="https://bhisshomologa.pbh.gov.br/bhiss-ws/nfse?wsdl%27" target="_blank">https://bhisshomologa.pbh.gov.br/bhiss-ws/nfse?wsdl'</a>);<br>
> $request->content($message);<br>
> $request->content_type("text/xml; charset=utf-8");<br>
> my $response = $userAgent->request($request);<br>
> if($response->code == 200) {<br>
> print $response->as_string;<br>
> }<br>
> else {<br>
> print $response->error_as_HTML;<br>
> }<br>
><br>
><br>
> Mas sempre o obtenho o seguinte erro:<br>
> SSL_connect:before/connect initialization<br>
> SSL_connect:SSLv3 write client hello A<br>
> SSL_connect:SSLv3 read server hello A<br>
> SSL_connect:SSLv3 read server certificate A<br>
> SSL_connect:SSLv3 read server key exchange A<br>
> SSL_connect:SSLv3 read server done A<br>
> SSL_connect:SSLv3 write client key exchange A<br>
> SSL_connect:SSLv3 write change cipher spec A<br>
> SSL_connect:SSLv3 write finished A<br>
> SSL_connect:SSLv3 flush data<br>
> SSL_connect:SSLv3 read finished A<br>
> <html><br>
> <head><title>An Error Occurred</title></head><br>
> <body><br>
> <h1>An Error Occurred</h1><br>
> <p>500 SSL read timeout: </p><br>
> </body><br>
> </html><br>
> Já pesquisei, alterei o tempo de timeout, mas nada. Alguém sabe o caminho<br>
> das pedras?<br>
> Desde já grato.<br>
> --<br>
> Geovanny Junio<br>
> Consultor de Tecnologia<br>
> geovanny (at) <a href="http://eutsiv.com.br" target="_blank">eutsiv.com.br</a><br>
> +55 31 9422-8885<br>
> +55 31 3393-9132<br>
> <a href="http://www.eutsiv.com.br" target="_blank">www.eutsiv.com.br</a><br>
><br>
> Este e-mail pode conter informação privilegiada e confidencial. Se você não<br>
> é destinatário da<br>
> mensagem, por favor apague a mensagem e comunique-nos o fato de imediato.<br>
><br>
> This e-mail contains information that may be<br>
> privileged and confidential. If you are not the intended recipient, please<br>
> delete the e-mail and notify us immediately.<br>
><br>
</div></div>> _______________________________________________<br>
> SaoPaulo-pm mailing list<br>
> <a href="mailto:SaoPaulo-pm@pm.org">SaoPaulo-pm@pm.org</a><br>
> <a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a><br>
><br>
<font color="#888888"><br>
<br>
<br>
--<br>
If you’ve never written anything thoughtful, then you’ve never had any<br>
difficult, important, or interesting thoughts. That’s the secret:<br>
people who don’t write, are people who don’t think.<br>
_______________________________________________<br>
SaoPaulo-pm mailing list<br>
<a href="mailto:SaoPaulo-pm@pm.org">SaoPaulo-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a><br>
</font></blockquote></div><br>