Problem with wss connection

#1

I have configured a crossbar WAMP Router to run WebSocket over TLS. The configuration options are the follow:


“transports”: [
{
“type”: “websocket”,
“endpoint”: {
“type”: “tcp”,
“port”: 8181,
“tls”:{
“key”:“server_key.pem”,
“certificate”:“server_cert.pem”
}
},
“debug”:true,
“options”:{
“enable_webstatus”:false,
“fail_by_drop”: true,
“open_handshake_timeout”: 2500,
“close_handshake_timeout”: 1000,
“auto_ping_interval”: 10000,
“auto_ping_timeout”: 5000,
“auto_ping_size”: 4
}
}
]

``

To verify the configuration I have created a little node.js application :

var autobahn = require(‘autobahn’);

var connection = new autobahn.Connection({
url: “wss://myserverIP:8181”,
realm: “realm”
});

connection.onopen = function (session, details) {
console.log(“OK”);
}

connection.onclose = function (reason, details) {
console.log(reason);
console.log(details);
}

``

When I try to connect to the crossbar WAMP router I get:

unreachable
{ reason: null,
message: null,
retry_delay: 2.1547574170790997,
retry_count: 2,
will_retry: true }

``

Anybody can help me to solve this problem ??

Thanks

0 Likes

#2

To track down your issue, you can enable_webstatus = true and open https://myserverIP:8181 in your browser.

This should render a status page.

My best guest: your certificate isn’t accepted by the browser.

···

Am Mittwoch, 8. Juli 2015 16:28:28 UTC+2 schrieb Andrea Rocco Lotronto:

I have configured a crossbar WAMP Router to run WebSocket over TLS. The configuration options are the follow:


“transports”: [
{
“type”: “websocket”,
“endpoint”: {
“type”: “tcp”,
“port”: 8181,
“tls”:{
“key”:“server_key.pem”,
“certificate”:“server_cert.pem”
}
},
“debug”:true,
“options”:{
“enable_webstatus”:false,
“fail_by_drop”: true,
“open_handshake_timeout”: 2500,
“close_handshake_timeout”: 1000,
“auto_ping_interval”: 10000,
“auto_ping_timeout”: 5000,
“auto_ping_size”: 4
}
}
]

``

To verify the configuration I have created a little node.js application :

var autobahn = require(‘autobahn’);

var connection = new autobahn.Connection({
url: “wss://myserverIP:8181”,
realm: “realm”
});

connection.onopen = function (session, details) {
console.log(“OK”);
}

connection.onclose = function (reason, details) {
console.log(reason);
console.log(details);
}

``

When I try to connect to the crossbar WAMP router I get:

unreachable
{ reason: null,
message: null,
retry_delay: 2.1547574170790997,
retry_count: 2,
will_retry: true }

``

Anybody can help me to solve this problem ??

Thanks

0 Likes

#3

Hi Tobias,

thank for the answer, I have I have followed your suggestion and now when I open the browser with the URL https://ipserve:8080, the crossbar WAMP router send me a info web page, the only issue is that the browser (Chrome) doesn’t verify the Certification Authority of the certificate.

But if I try to connect to the crossbar WAMP router using a node.js application the problem persist.

Can you suggest me how I can solve this problem.

···

On Thursday, 9 July 2015 13:29:01 UTC+2, Tobias Oberstein wrote:

To track down your issue, you can enable_webstatus = true and open [https://myserverIP:8181](https://myserverIP:8181) in your browser.

This should render a status page.

My best guest: your certificate isn’t accepted by the browser.

Am Mittwoch, 8. Juli 2015 16:28:28 UTC+2 schrieb Andrea Rocco Lotronto:

I have configured a crossbar WAMP Router to run WebSocket over TLS. The configuration options are the follow:


“transports”: [
{
“type”: “websocket”,
“endpoint”: {
“type”: “tcp”,
“port”: 8181,
“tls”:{
“key”:“server_key.pem”,
“certificate”:“server_cert.pem”
}
},
“debug”:true,
“options”:{
“enable_webstatus”:false,
“fail_by_drop”: true,
“open_handshake_timeout”: 2500,
“close_handshake_timeout”: 1000,
“auto_ping_interval”: 10000,
“auto_ping_timeout”: 5000,
“auto_ping_size”: 4
}
}
]

``

To verify the configuration I have created a little node.js application :

var autobahn = require(‘autobahn’);

var connection = new autobahn.Connection({
url: “wss://myserverIP:8181”,
realm: “realm”
});

connection.onopen = function (session, details) {
console.log(“OK”);
}

connection.onclose = function (reason, details) {
console.log(reason);
console.log(details);
}

``

When I try to connect to the crossbar WAMP router I get:

unreachable
{ reason: null,
message: null,
retry_delay: 2.1547574170790997,
retry_count: 2,
will_retry: true }

``

Anybody can help me to solve this problem ??

Thanks

0 Likes

#4

Hi Tobias,
thank for the answer, I have I have followed your suggestion and now
when I open the browser with the URL https://ipserve:8080, the crossbar
WAMP router send me a info web page, the only issue is that the browser
(Chrome) doesn't verify the Certification Authority of the certificate.

But if I try to connect to the crossbar WAMP router using a node.js
application the problem persist.

Yes. That's how browsers work. If opening a Web page with an invalid cert, the browser will render a user dialog.

However, WebSocket connections are so-called "subresources", and browsers never render dialogs for these, and the secure connection will just silently fail.

Can you suggest me how I can solve this problem.

Use a valid cert, import the CA cert into your browser, or first open the status Web page and accept the cert permanently (this only works in FF I think ..).

···

Am 09.07.2015 um 15:14 schrieb Andrea Rocco Lotronto:

On Thursday, 9 July 2015 13:29:01 UTC+2, Tobias Oberstein wrote:

    To track down your issue, you can enable_webstatus = true and open
    >https://myserverIP:8181| in your browser.

    This should render a status page.

    My best guest: your certificate isn't accepted by the browser.

    Am Mittwoch, 8. Juli 2015 16:28:28 UTC+2 schrieb Andrea Rocco Lotronto:

        I have configured a crossbar WAMP Router to run WebSocket over
        TLS. The configuration options are the follow:

        >
        .....
        "transports":[
        {
        "type":"websocket",
        "endpoint":{
        "type":"tcp",
        "port":8181,
        "tls":{
        "key":"server_key.pem",
        "certificate":"server_cert.pem"
        }
        },
        "debug":true,
        "options":{
        "enable_webstatus":false,
        "fail_by_drop":true,
        "open_handshake_timeout":2500,
        "close_handshake_timeout":1000,
        "auto_ping_interval":10000,
        "auto_ping_timeout":5000,
        "auto_ping_size":4
        }
        ]
        ......
        >

        To verify the configuration I have created a little node.js
        application :

        >
        varautobahn =require('autobahn');

        varconnection =newautobahn.Connection({
                 url:"wss://myserverIP:8181",
                 realm:"realm"
        });

        connection.onopen =function(session,details){
                 console.log("OK");
        }

        connection.onclose =function(reason,details){
                 console.log(reason);
                 console.log(details);
        }
        >

        When I try to connect to the crossbar WAMP router I get:

        >
        unreachable
        {reason:null,
           message:null,
           retry_delay:2.1547574170790997,
           retry_count:2,
           will_retry:true}
        >

        Anybody can help me to solve this problem ??

        Thanks

--
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com
<mailto:autobahnws+...@googlegroups.com>.
To post to this group, send email to autob...@googlegroups.com
<mailto:autob...@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/autobahnws/4b21a286-7552-4200-8306-ca0df4e36ed3%40googlegroups.com
<https://groups.google.com/d/msgid/autobahnws/4b21a286-7552-4200-8306-ca0df4e36ed3%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

0 Likes

#5

Sorry, I guess I wasn’t clear enough. In particular, I’m using a simple, standalone Node.js script, i.e., out of the browser. Is there a way to specify (perhaps in autobahn.Connection() ?) to accept self-signed or otherwise invalid server certificates?

Best Regards!

···

On Thursday, 9 July 2015 16:23:29 UTC+2, Tobias Oberstein wrote:

Am 09.07.2015 um 15:14 schrieb Andrea Rocco Lotronto:

Hi Tobias,

thank for the answer, I have I have followed your suggestion and now

when I open the browser with the URL https://ipserve:8080, the crossbar

WAMP router send me a info web page, the only issue is that the browser

(Chrome) doesn’t verify the Certification Authority of the certificate.

But if I try to connect to the crossbar WAMP router using a node.js

application the problem persist.

Yes. That’s how browsers work. If opening a Web page with an invalid
cert, the browser will render a user dialog.

However, WebSocket connections are so-called “subresources”, and
browsers never render dialogs for these, and the secure connection will
just silently fail.

Can you suggest me how I can solve this problem.

Use a valid cert, import the CA cert into your browser, or first open
the status Web page and accept the cert permanently (this only works in
FF I think …).

On Thursday, 9 July 2015 13:29:01 UTC+2, Tobias Oberstein wrote:

To track down your issue, you can enable_webstatus = true and open
>https://myserverIP:8181| in your browser.
This should render a status page.
My best guest: your certificate isn't accepted by the browser.
Am Mittwoch, 8. Juli 2015 16:28:28 UTC+2 schrieb Andrea Rocco Lotronto:
    I have configured a crossbar WAMP Router to run WebSocket over
    TLS. The configuration options are the follow:
    >
    .....
    "transports":[
    {
    "type":"websocket",
    "endpoint":{
    "type":"tcp",
    "port":8181,
    "tls":{
    "key":"server_key.pem",
    "certificate":"server_cert.pem"
    }
    },
    "debug":true,
    "options":{
    "enable_webstatus":false,
    "fail_by_drop":true,
    "open_handshake_timeout":2500,
    "close_handshake_timeout":1000,
    "auto_ping_interval":10000,
    "auto_ping_timeout":5000,
    "auto_ping_size":4
    }
    }
    ]
    ......
    >
    To verify the configuration I have created a little node.js
    application :
    >
    varautobahn =require('autobahn');
    varconnection =newautobahn.Connection({
             url:"wss://myserverIP:8181",
             realm:"realm"
    });
    connection.onopen =function(session,details){
             console.log("OK");
    }
    connection.onclose =function(reason,details){
             console.log(reason);
             console.log(details);
    }
    >
    When I try to connect to the crossbar WAMP router I get:
    >
    unreachable
    {reason:null,
       message:null,
       retry_delay:2.1547574170790997,
       retry_count:2,
       will_retry:true}
    >
    Anybody can help me to solve this problem ??
    Thanks

You received this message because you are subscribed to the Google

Groups “Autobahn” group.

To unsubscribe from this group and stop receiving emails from it, send

an email to autobah...@googlegroups.com

mailto:autobahnws+...@googlegroups.com.

To post to this group, send email to auto...@googlegroups.com

mailto:auto...@googlegroups.com.

To view this discussion on the web visit

https://groups.google.com/d/msgid/autobahnws/4b21a286-7552-4200-8306-ca0df4e36ed3%40googlegroups.com

<https://groups.google.com/d/msgid/autobahnws/4b21a286-7552-4200-8306-ca0df4e36ed3%40googlegroups.com?utm_medium=email&utm_source=footer>.

For more options, visit https://groups.google.com/d/optout.

0 Likes

#6

Hi Andrea,

Sorry, I guess I wasn't clear enough. In particular, I'm using a simple,
standalone Node.js script, i.e., out of the browser. Is there a way to
specify (perhaps in autobahn.Connection() ?) to accept self-signed or
otherwise invalid server certificates?

Not in AutobahnJS itself.

AutobahnJS is using https://github.com/websockets/ws for WebSocket on Node.

Either it's possible there, or via a Node general solution. I don't know.

If you find out, would be nice if you could report back here!

Cheers,
/Tobias

···

Am 09.07.2015 um 16:55 schrieb Andrea Rocco Lotronto:

Best Regards!

On Thursday, 9 July 2015 16:23:29 UTC+2, Tobias Oberstein wrote:

    Am 09.07.2015 um 15:14 schrieb Andrea Rocco Lotronto:
     > Hi Tobias,
     > thank for the answer, I have I have followed your suggestion and now
     > when I open the browser with the URL https://ipserve:8080, the
    crossbar
     > WAMP router send me a info web page, the only issue is that the
    browser
     > (Chrome) doesn't verify the Certification Authority of the
    certificate.
     >
     > But if I try to connect to the crossbar WAMP router using a node.js
     > application the problem persist.

    Yes. That's how browsers work. If opening a Web page with an invalid
    cert, the browser will render a user dialog.

    However, WebSocket connections are so-called "subresources", and
    browsers never render dialogs for these, and the secure connection will
    just silently fail.

     >
     > Can you suggest me how I can solve this problem.

    Use a valid cert, import the CA cert into your browser, or first open
    the status Web page and accept the cert permanently (this only works in
    FF I think ..).

     >
     > On Thursday, 9 July 2015 13:29:01 UTC+2, Tobias Oberstein wrote:
     >
     > To track down your issue, you can enable_webstatus = true and
    open
     > >https://myserverIP:8181| in your browser.
     >
     > This should render a status page.
     >
     > My best guest: your certificate isn't accepted by the browser.
     >
     > Am Mittwoch, 8. Juli 2015 16:28:28 UTC+2 schrieb Andrea Rocco > Lotronto:
     >
     > I have configured a crossbar WAMP Router to run WebSocket
    over
     > TLS. The configuration options are the follow:
     >
     > >
     > .....
     > "transports":[
     > {
     > "type":"websocket",
     > "endpoint":{
     > "type":"tcp",
     > "port":8181,
     > "tls":{
     > "key":"server_key.pem",
     > "certificate":"server_cert.pem"
     > }
     > },
     > "debug":true,
     > "options":{
     > "enable_webstatus":false,
     > "fail_by_drop":true,
     > "open_handshake_timeout":2500,
     > "close_handshake_timeout":1000,
     > "auto_ping_interval":10000,
     > "auto_ping_timeout":5000,
     > "auto_ping_size":4
     > }
     > ]
     > ......
     > >
     >
     > To verify the configuration I have created a little node.js
     > application :
     >
     > >
     > varautobahn =require('autobahn');
     >
     > varconnection =newautobahn.Connection({
     > url:"wss://myserverIP:8181",
     > realm:"realm"
     > });
     >
     > connection.onopen =function(session,details){
     > console.log("OK");
     > }
     >
     > connection.onclose =function(reason,details){
     > console.log(reason);
     > console.log(details);
     > }
     > >
     >
     > When I try to connect to the crossbar WAMP router I get:
     >
     > >
     > unreachable
     > {reason:null,
     > message:null,
     > retry_delay:2.1547574170790997,
     > retry_count:2,
     > will_retry:true}
     > >
     >
     > Anybody can help me to solve this problem ??
     >
     > Thanks
     >
     > --
     > You received this message because you are subscribed to the Google
     > Groups "Autobahn" group.
     > To unsubscribe from this group and stop receiving emails from it,
    send
     > an email to autobah...@googlegroups.com <javascript:>
     > <mailto:autobahnws+...@googlegroups.com <javascript:>>.
     > To post to this group, send email to auto...@googlegroups.com
    <javascript:>
     > <mailto:auto...@googlegroups.com <javascript:>>.
     > To view this discussion on the web visit
     >
    https://groups.google.com/d/msgid/autobahnws/4b21a286-7552-4200-8306-ca0df4e36ed3%40googlegroups.com

     >
    <https://groups.google.com/d/msgid/autobahnws/4b21a286-7552-4200-8306-ca0df4e36ed3%40googlegroups.com?utm_medium=email&utm_source=footer>.

     > For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com
<mailto:autobahnws+...@googlegroups.com>.
To post to this group, send email to autob...@googlegroups.com
<mailto:autob...@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/autobahnws/f8d34dc9-f9aa-4263-9a8b-0d33673364a6%40googlegroups.com
<https://groups.google.com/d/msgid/autobahnws/f8d34dc9-f9aa-4263-9a8b-0d33673364a6%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

0 Likes