title: Get SSL error SSL_ERROR_RX_RECORD_TOO_LONG in server side
body: <p>I have written my own webserver in C#.</p>
  
  <p>And I always established SSL certificates for my sites in new IP on port 443. And always it works fine.</p>
  
  <p>But this time I get this error:</p>
  
  <blockquote>
    <p>Secure Connection Failed</p>
    
    <p>An error occurred during a connection to www.sayehrooshan-co.com. SSL received a record that exceeded the maximum permissible length. Error code: </p>
    
    <p><strong>SSL_ERROR_RX_RECORD_TOO_LONG</strong></p>
    
    <p>The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.
        Please contact the website owners to inform them of this problem.</p>
  </blockquote>
  
  <p>this is page address:</p>
  
  <p><a href="https://www.sayehrooshan-co.com" rel="nofollow noreferrer">https://www.sayehrooshan-co.com</a></p>
  
  <p>this is my code always worked with .pfx file for other sites:</p>
  
  <pre><code>sslstream = new SslStream(new NetworkStream(mySocket, false), false);
  //commented for nedaye arzhang
  X509Certificate2 serverCertificate = new X509Certificate2(Path, Password);
  //X509Certificate2 serverCertificate = new X509Certificate2("www_nedaye-arzhang_com.cer");                           
  
  sslstream.AuthenticateAsServer(serverCertificate, false, System.Security.Authentication.SslProtocols.Tls, true);
  </code></pre>
  
  <p>searched alot but didn't get any solution
  Anyone get any idea?</p>