title: OpenSSL compile error undefined reference
body: <p>I am getting the following error when I try to compile openssl. I am using bazel and am using gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0. I am using Openssl 1.1.1i.</p>
  <pre><code>util/netevent.c:1062: error: undefined reference to 'SSL_get1_peer_certificate'
  util/netevent.c:1088: error: undefined reference to 'SSL_get1_peer_certificate'
  collect2: error: ld returned 1 exit status
  
  </code></pre>
  <p>This is the BUILD file I wrote to wrap openssl. Also previously this was building so I am not sure why things changed.</p>
  <pre><code>package(default_visibility = [&quot;//visibility:public&quot;])
  
  cc_library(
   name = &quot;libssl&quot;,
   srcs = glob([&quot;**/libssl.a&quot;]),
   hdrs = glob([&quot;**/ssl/**/*.h&quot;])
  )
  
  cc_library(
   name = &quot;libcrypto&quot;,
   srcs = glob([&quot;**/libcrypto.a&quot;]),
   hdrs = glob([&quot;**/crypto/**/*.h&quot;])
  )
  
  </code></pre>
  <p>OpenSSL configures with</p>
  <pre><code>Operating system: x86_64-whatever-linux2
  Configuring OpenSSL version 1.1.1i (0x1010108fL) for linux-x86_64
  </code></pre>
  <p>I am linking with -lssl and -lcrypto.</p>
  <p>I am thinking the issue is with the library I am using because it builds and somehow gets <code>SSL_get1_peer_certificate</code> rather than <code>SSL_get_peer_certificate</code></p>
  <p>I greped and the actual file it builds uses the correct function but the binary file has the wrong one...</p>