Error in network establishment (net::ERR_CERT_COMMON_NAME_INVALID)

Hi, recently I've got the Photon Server setup thanks to @vadim ! However, as i upload my games on, i need to use wss connections. Using wss connection causes this issue and I can't connect:
Photon-Javascript_SDK.js:1 WebSocket connection to 'wss://' failed: Error in connection establishment: net::ERR_CERT_COMMON_NAME_INVALID

I used to use the Photon Engine plugin for Construct 2 and am still able to enable wss connections there, as well as upload on the same site without any hitch. Now that I'm trying to use a new engine that requires my own coding, I think I did not resolve the secure certificates portion.

How can I resolve this problem with minimal setup? Photon Engine realtime plugin for Construct 2 had great coverage as the wss connection worked across almost all platforms. I read online about how to manually solve this certificate problem and mostly mentioned using OpenSSL and stuff, which I'm not sure if the Photon Engine plugin for Construct 2 did implicitly. Any pointers would be appreciated!


  • This is all the code related to my simple connection setup for my JavaScript game in Cocos Creator:

  • I think I solved it so far..
    Error was that I did

    What I should have done was
  • Hi,
    connectToRegionMaster() and connectToNameServer() are two methods implementing up-to-date workflow using name server. connect() connects directly to a master server (at address specified in setMasterServerAddress) and normally should not be used.