title: How to run c# websockets over TLS when both client and server location are dynamic?
body: <p>I am trying to get a secured Websocket line going when both ends of the connection are on variable locations.</p>
  
  <p>What im doing:</p>
  
  <p>I have a c# program running a Websocket <strong>server</strong> (Fleck), this program is deployed to the user's machine.
  Next, i have both a website and an android app running Websocket <strong>clients</strong> (in javascript and java respectively). The clients know how to connect to the server (queried from database via php). </p>
  
  <p>So this way a direct connection is made from the client to the server, without going thru a website or anything, this is primarly since it can contain sensitve information and not having the website having to touch that is a giant plus! The website itself is running HTTPS using a trusted certificate.</p>
  
  <p>The c# Fleck server requires a pfx certificate for WSS, i tried making that using openSSL and the certificate i use for the website. But the browser silently drops the connection when a websocket certificate is no good. If i go to http<strong>s</strong>://localhost:port i get the expected browser warning that my domain isn't matching with the certificate, the same error is probably why the browser drops the websocket connection, since neither the user's PC or any computer/phone they connect from is using that domain.</p>
  
  <p>If my above observations are correct, in essence i would need something like a trusted certificate with a variable domain. Does such a thing exist?</p>
  
  <p>Thanks for your time!</p>