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"><<a href="mailto:daniel.oliveira.mantovani@gmail.com">daniel.oliveira.mantovani@gmail.com</a>></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>
[]'s<br>
<br>
2010/1/12 eutsiv :: Geovanny Junio <<a href="mailto:geovanny@eutsiv.com.br">geovanny@eutsiv.com.br</a>>:<br>
> Olá companheiros,<br>
> Os erros continuam, e eu já fiz tudo possível. Estava num ambiente Linux<br>
> (Debian), resolvi testar no windows XP com o Strawberry, funcionou de<br>
> primeira.<br>
> Acho que agora ficou mais fácil de achar o problema, assim que descobrir<br>
> posto aqui.<br>
<div class="im">> 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>
><br>
</div><div class="im">> 2010/1/9 Lindolfo "Lorn" Rodrigues <<a href="http://lorn.br" target="_blank">lorn.br</a>@<a href="http://gmail.com" target="_blank">gmail.com</a>><br>
>><br>
</div><div><div></div><div class="h5">>> Você está certo, o LWP::UserAgent toma conta do SSL, mas você está usando<br>
>> o HTTP::Response! o LWP já usa ele por você.<br>
>> require LWP::UserAgent;<br>
>><br>
>> my $ua = LWP::UserAgent->new;<br>
>> my $response = $ua->get('<a href="https://www.submarino.com.br/'" target="_blank">https://www.submarino.com.br/'</a>);<br>
>> print $response->content;<br>
>> Faz o teste com seu post, usando o LWP direto, sem usar o HTTP::Response e<br>
>> ve se da certo<br>
>><br>
>> 2010/1/9 eutsiv :: Geovanny Junio <<a href="mailto:geovanny@eutsiv.com.br">geovanny@eutsiv.com.br</a>><br>
>>><br>
>>> Olá Daniel, tudo bem?<br>
>>><br>
>>> Quando a URL inicia com https, o LWP já faz uso do Crypt::SSLeay ou<br>
>>> Net::SSL.<br>
>>> E as duas já estão instaladas, na verdade parece que o handshake é<br>
>>> interrompido no finalzinho.<br>
>>><br>
>>> Fiz testes e mais testes, acho que minha saída é tentar implementar sem<br>
>>> Lwp (gerar as requisições "na mão"), fazendo chamada ao Net::SSL na hora da<br>
>>> criptografia, e ver onde o processo de handshake pára.<br>
>>><br>
>>> Grato,<br>
>>><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ê<br>
>>> 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,<br>
>>> please<br>
>>> delete the e-mail and notify us immediately.<br>
>>><br>
>>><br>
>>> 2010/1/9 Daniel de Oliveira Mantovani<br>
>>> <<a href="mailto:daniel.oliveira.mantovani@gmail.com">daniel.oliveira.mantovani@gmail.com</a>><br>
>>>><br>
>>>> 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 =><br>
>>>> <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>
>>>><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>
>>>> > 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'" 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<br>
>>>> > 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<br>
>>>> > você não<br>
>>>> > é destinatário da<br>
>>>> > mensagem, por favor apague a mensagem e comunique-nos o fato de<br>
>>>> > imediato.<br>
>>>> ><br>
>>>> > This e-mail contains information that may be<br>
>>>> > privileged and confidential. If you are not the intended recipient,<br>
>>>> > please<br>
>>>> > delete the e-mail and notify us immediately.<br>
>>>> ><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>
>>>> ><br>
>>>><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>
>>><br>
>>><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>
>><br>
>><br>
>><br>
>> --<br>
>> lorn at lornlab dot org<br>
>> Lindolfo "Lorn" Rodrigues<br>
>><br>
>><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>
><br>
><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>
><br>
<br>
<br>
<br>
--<br>
"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."<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>