title: Disable weak ciphers of OpenSSL on the server side
body: <p>I'm using OpenSSL for my server developed in C.</p>
  
  <p>OpenSSL is called in my source code in the following way:</p>
  
  <pre><code>SSL_CTX* InitServerCTX(void)
  {
      SSL_METHOD *method;
      SSL_CTX *ctx;
  
      OpenSSL_add_all_algorithms();  /* load &amp; register all cryptos, etc. */
      SSL_load_error_strings();   /* load all error messages */
      method = TLSv1_2_server_method();  /* create new server-method instance */
      ctx = SSL_CTX_new(method);   /* create new context from method */
      if ( ctx == NULL )
      {
          ERR_print_errors_fp(stderr);
          abort();
      }
      return ctx;
  }
  
  int main(int count, char *Argc[])
  {   
      SSL_CTX *ctx;
      int server;
      char *portnum;
  
      // Initialize the SSL library
      SSL_library_init();
      ctx = InitServerCTX();        /* initialize SSL */
      ...
  }
  </code></pre>
  
  <p>I tested my server with <a href="https://sslabs.com" rel="nofollow noreferrer">ssllabs.com</a>. and I got weaks in the supported ciphers on my server.</p>
  
  <p><a href="https://i.stack.imgur.com/tfebX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tfebX.png" alt="image"></a></p>
  
  <p>How to disable these weak ciphers in my server?</p>
  
  <p><strong>---EDIT---</strong></p>
  
  <p>I tried to add the following line after initiating context</p>
  
  <pre><code>SSL_CTX_set_cipher_list(ctx, "ALL:!NULL-MD5:!NULL-SHA:!NULL-RSA");
  </code></pre>
  
  <p>But nothing change!</p>