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