rosbridge cannot connect to secure websocket, timed out error
I am using rosbridge and roslibjs to connect to ros. I wrote an HTML page that publishes a simple std_msgs::String message. I need to serve this page through HTTPS, therefore I have to connect to rosbridge through the wss protocol. Using simple http and ws it all works, but then I switch to the secure protocol i get the following error in the javascript console:
WebSocket connection to 'wss://localhost:9090/' failed: Error in connection establishment: net::ERR_TIMED_OUT
I serve the web page using apache default-ssl site and start rosbridge as follows:
roslaunch rosbridge_server rosbridge_websocket.launch ssl:=true certfile:=/etc/ssl/certs/ssl-cert-snakeoil.pem keyfile:=/etc/ssl/private/ssl-cert-snakeoil.key authenticate:=false
To connect to rosbridge I use:
$(document).ready(function(){ var ros = new ROSLIB.Ros({
url : 'wss://localhost:9090' });
ros.on('connection', function() {
console.log('Connected to websocket server.'); });
ros.on('error', function(error) {
console.log('Error connecting to websocket server: ', error); });
ros.on('close', function() {
console.log('Connection to websocket server closed.'); });
});
I am running ROS Groovy on Ubuntu 12.04 on a x86 machine. I am using rosbridge version 0.5.6-1precise-20140906-1447-+0000