title: Migration of default BIO_METHOD from OpenSSL 1.0.2 to 1.1.1
body: <p>I'm trying to port my application code from OpenSSL 1.0.2 to 1.1.1 and I came across a change I can't seem to understand.</p>
  
  <p>In 1.0.2 we have replaced the default <code>bread</code> and <code>bwrite</code> methods of <code>BIO_s_socket</code> by calling:</p>
  
  <pre><code>orig_bread = BIO_s_socket()-&gt;bread;
  orig_bwrite = BIO_s_socket()-&gt;bwrite;
  BIO_s_socket()-&gt;bread = my_bread;
  BIO_s_socket()-&gt;bwrite = my_bwrite;
  </code></pre>
  
  <p>However, in OpenSSL 1.1.1 <code>BIO_s_socket()</code> is said to return <code>const BIO_METHOD*</code> instead of <code>BIO_METHOD*</code>. How can I change the default behavior in this version?</p>
  
  <p>Edit: (...and if can't do it anymore, how do I set a bread and bwrite per ssl connection?)</p>