I have a program that works fine with non secure link to server.
When I try to connect to wss link the connection process lasts about 1 minute and then throws following:
Assuming everything was the same on each attempt, the fact you got a connection OK twice would suggest to me that your connection details & certificate are OK.
Try the suggestions from @OliverA and @Erel in posts #2 & #3 of the thread I linked to.
Updating to the latest version can't harm as well.
Yes, sorry, I didn't realise that you weren't writing the server as well.
If it does connect eventually when you retry and if you can wait for it, there's an auto-reconnect example in the Custom WebSocket Based Push Framework.