1
我構建了一個基於SSL的apache mod_perl web服務。當然,在我的瀏覽器中,我可以使用https訪問web服務(cource,簽署了CA證書給瀏覽者的信任列表)訪問Web服務,但是當使用SOAP :: Lite時,我失敗了。 這是我的源代碼:使用基於https的SOAP :: Lite,證書驗證失敗
$ENV{HTTPS_CERT_FILE} = '/etc/pki/tls/mycerts/client.crt';
$ENV{HTTPS_KEY_FILE} = '/etc/pki/tls/mycerts/client.key';
#$ENV{HTTPS_CA_FILE} = '/etc/pki/tls/mycerts/ca.crt';
#$ENV{HTTPS_CA_DIR} = '/etc/pki/tls/mycerts/ca.key';
#$ENV{HTTPS_VERSION} = 3;
$ENV{SSL_ca_file}='/etc/pki/tls/mycerts/ca.crt';
$ENV{SSL_ca_pah}='/etc/pki/tls/mycerts/';
#$ENV{SSL_cert_file}='/etc/pki/tls/mycerts/client.key';
#$ENV{SSL_key_file}='/etc/pki/tls/mycerts/client.crt';
$ENV{PERL_LWP_SSL_CA_FILE}='/etc/pki/tls/mycerts/ca.crt';
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}=1;
#$ENV{PERL_LWP_SSL_CA_PATH}='/etc/pki/tls/mycerts/';
use SOAP::Lite;
my $name = "wuchang";
print "\n\nCalling the SOAP Server to say hello\n\n";
print SOAP::Lite
-> uri('http://localhost/mod_perl_rules1')
-> proxy('https://localhost/mod_perl_rules1')
-> result;
我得到的迴應:
500 Can't connect to localhost:443 (certificate verify failed) at /root/Desktop/test.pl line 18
我真的無法調試this.I不知道是不是我的證書格式是incorrect.I使用OpenSSL生成我包括客戶端證書,服務器證書和我自簽名的CA證書,並且我讓CA簽署客戶端和服務器證書。我真的不知道發生了什麼問題/。
可能重複[如何獲得LWP驗證SSL服務器證書?](http://stackoverflow.com/questions/74358/how-can-i-get-lwp-to-validate-ssl-server-證書) – rjzii