PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Sun Jun 07, 2020 4:23 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Thu Oct 06, 2011 10:39 am 
Offline
Forum Newbie

Joined: Thu Oct 06, 2011 10:26 am
Posts: 2
Hi All,
I really need help.
I am now reprogramming a soapClient to another server. I want to call web services on that server.
I need this connection to be over https.
To connect to the server over https I have no problem.
The problem is to verify the server certificate.

I tried this:
Syntax: [ Download ] [ Hide ]
$context = stream_context_create(
                array(
                        'SSL' => array(
                                'allow_self_signed' => FALSE,
                                                                "verify_peer " => TRUE,
                                                                "cafile" => $fileName,
                                                                "capture_peer_cert" => TRUE
                        )
                )
        );

        $client = new SoapClient("https://<someServer>/WebService.asmx?WSDL",
        array("exceptions" => 1,"stream_context" => $context));

        $result1 = $client->HelloWorld();

        print_r($result1);
 

but this work if the server certificate is fine and even if i connect to the server through other host name it still works. while it shouldn't( I didn't replace the certificate only the host name).

Please... help... :)
Ben


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group