Skip to content

Commit

Permalink
demo SSL connection script
Browse files Browse the repository at this point in the history
  • Loading branch information
videlalvaro committed Oct 9, 2011
1 parent c12029a commit fbbab69
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions demo/ssl_connection.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

require_once(__DIR__ . '/../amqp.inc');

define('HOST', 'localhost');
define('PORT', 5671);
define('USER', 'guest');
define('PASS', 'guest');
define('VHOST', '/');

//If this is enabled you can see AMQP output on the CLI
define('AMQP_DEBUG', true);

define('CERTS_PATH',
'/git/rabbitmqinaction/av_scratchwork/openssl');

$ssl_options = array(
'cafile' => CERTS_PATH . '/rmqca/cacert.pem',
'local_cert' => CERTS_PATH . '/phpcert.pem',
'verify_peer' => true
);

$conn = new AMQPSSLConnection(HOST, PORT, USER, PASS, VHOST, $ssl_options);

function shutdown($conn){
$conn->close();
}

register_shutdown_function('shutdown', $conn);

while(1){}

0 comments on commit fbbab69

Please sign in to comment.