monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: monitor ssl websocket (wss://)


From: Lutz Mader
Subject: Re: monitor ssl websocket (wss://)
Date: Wed, 19 Jan 2022 00:24:17 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

Hello,
nice to know, I try to find a test environment also,
but 200 should be ok. Do you try to test the connection without the
suggested header options also.

Status description
100 Continue
101 Switching Protocols
103 Early Hints
200 OK

Status 101 confirms the protocol change only. For a connection test the
200 should be ok also.

>> I'd like to monitor it for reachability and SSL certificate expiration.

And the certificate can checked by an additional "certificate valid > 30
days".

With regards,
Lutz


Am 18.01.22 um 20:56 schrieb sashk:
> Hi Lutz,
> 
> Thanks for your answer. Perhaps I'm doing something wrong, but I'm not
> getting status 101, but instead getting status 200. Here is portion of
> my config. As a test I tried to use same options without https and
> everything seems to be working properly.
> 
> I tried to run monit with -v option to see more detailed log, but it
> only shows one line saying that check failed.
> 
> check host ws-host.domain.com with address host.domain.com
> if failed
> port 8801 protocol https
> with http headers [Upgrade: websocket,
> Connection: Upgrade,
> Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==,
> Sec-WebSocket-Protocol: "chat, superchat",
> Sec-WebSocket-Version: 13]
> request "/"
> status = 101
> then alert
> # using server.go from
> https://github.com/gorilla/websocket/tree/master/examples/echo
> check host localhost with address localhost
> if failed
> port 8080 protocol http
> with http headers [Upgrade: websocket,
> Connection: Upgrade,
> Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==,
> Sec-WebSocket-Protocol: "chat, superchat",
> Sec-WebSocket-Version: 13]
> request "/echo"
> status = 101
> then alert
> 
> 
> 
> 
> 
> On 1/17/22 6:49 AM, lutz.mader@freenet.de wrote:
>> Hello,
>> do you spent some time to have a look to the protocol http/https and
>> use the header option to modify the header sent by the https request.
>> See https://mmonit.com/monit/documentation/monit.html#HTTP
>> To initialize a websocket session a normal https request contain some
>> additional header information
>>
>> Upgrade: websocket
>> Connection: Upgrade
>> Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==
>> Sec-WebSocket-Protocol: chat, superchat
>> Sec-WebSocket-Version: 13
>>
>> And the server should response with status 101 to accept the request.
>> For additional information see
>> https://datatracker.ietf.org/doc/html/rfc6455
>>
>> A suggestion only,
>> Lutz
>>
>> p.s.
>> I try to find a useful test case myself.
>>
>>
>> -----ursprüngliche Nachricht-----
>>  Von: b@sashk.xyz
>>  Gesendet: 15.01.2022 18:16 Uhr
>>  An: monit-general@nongnu.org
>>  Betreff: monitor ssl websocket (wss://)
>>
>> Hi,
>>
>> Is it possible to monitor wss://  websocket using Monit?
>>
>>
>> I've tried several configurations, but none of them works and example in
>> the user guide is for unsecured websocket.
>>
>> I'd like to monitor it for reachability and SSL certificate expiration.
>>
>> Any help is appreciated,
>>
>> Thanks.
>>
>> -------- Конец пересылаемого сообщения --------
>>
>> -----ursprüngliche Nachricht Ende-----
>>
>>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]