B4J Question Explain it like I'm 5: How to deploy websocket Jetty/BANananoServer apps to use https?

Mashiane

Expert
Licensed User
Longtime User
Ola

I usually just give people source code and what they do after that is usually none of my business. So this part of the whole operation, frankly I don't know. Don't laugh.
People talk about key stroke files etc, and ill be like, WTFoozball?

Anyway, I kinda request anyone who has the utmost of patience, and willing and who knows about this aspect to please help a brother out, in laymen's terms, explaining every possible jargon, with step by step, how to do this?

Humbly thanking you.
 

EnriqueGonzalez

Expert
Licensed User
Longtime User
Aeric has a good tutorial on ssl (https)

But In my humble opinion, that's lot of work, in todays modern world the best option is to use a reverse proxy. That's my 2 cents
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
i see websocket and https in the same sentence, and i have to tell you websockets don't use https. they use wss. the same, only different. you need a websockets server, either outward-facing or sitting behind an https server (as a proxy). sorry, i'm not a banano-phile, so i can't help beyond that. if node runs on a banano, you're half way there. your https cert is acceptable to the wss server.
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
excellent. op's linking websockets and https still unclear. is he trying to connect to a websocket server using https? he can connect to an https server, which might handle the necessary handshake to websocket protocol. jetty claims to do this, depending on the version. plus he'll need a websocket client on the user's side. in any case, my interest was to point out that websockets don't use https, meaning that some clarification was needed.
 
Last edited:
Upvote 0

tchart

Well-Known Member
Licensed User
Longtime User
Ola

I usually just give people source code and what they do after that is usually none of my business. So this part of the whole operation, frankly I don't know. Don't laugh.
People talk about key stroke files etc, and ill be like, WTFoozball?

Anyway, I kinda request anyone who has the utmost of patience, and willing and who knows about this aspect to please help a brother out, in laymen's terms, explaining every possible jargon, with step by step, how to do this?

Humbly thanking you.
@Mashiane assuming you are just providing HTML+JavaScript?

Setting up https really depends on what web server the customer are using. Many of my customers run Windows and as a result would be using Microsoft IIS.

Most of the tutorials on this forum will be aimed at setting up https/SSL for Jetty (ie jServer).

The workflow for each web server type are very different.
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
i see websocket and https in the same sentence, and i have to tell you websockets don't use https. they use wss. the same, only different. you need a websockets server, either outward-facing or sitting behind an https server (as a proxy). sorry, i'm not a banano-phile, so i can't help beyond that. if node runs on a banano, you're half way there. your https cert is acceptable to the wss server.
I understand not being a BANano-phile, thing is, the BANanoServer template (BROWSERIndex) provided has this, there is also a SERVERIndex, template we are using. As most of these seem to be abstracted, Im lost in translation.

B4X:
'Initializes the object. You can NOT add extra parameters!
Public Sub Initialize
    'Log("BrowserIndex initialize")
    ' does the browser support websockets?
    If ws.IsSupported Then
        ' here we connect to our SERVERIndex websocket class using the 'classic' B4J Websocket events WebSocket_Connected and WebSocket_Disconnected
        ws.Initialize("ws://" & BANano.Location.GetHost & "/ws/" & BANano.StaticFolder & "/index")
    End If
End Sub
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
Aeric has a good tutorial on ssl (https)

But In my humble opinion, that's lot of work, in todays modern world the best option is to use a reverse proxy. That's my 2 cents
Thanks, Im running a Windows Machine, whilst clients of course run Linux of other, so still there are challenges here and there.
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
@Mashiane assuming you are just providing HTML+JavaScript?

Setting up https really depends on what web server the customer are using. Many of my customers run Windows and as a result would be using Microsoft IIS.

Most of the tutorials on this forum will be aimed at setting up https/SSL for Jetty (ie jServer).

The workflow for each web server type are very different.
Good shot, yes the intended usage is for Jetty.
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
You can try to use my ABKeyStoreSSL library for Let's Encrypt certificates:
Wow, thanks, eish im really struggling here, please see some follow up questions:

 
Upvote 0
Top