diff --git a/src/lib/socket.c b/src/lib/socket.c
index 390896f..51ac128 100644
--- a/src/lib/socket.c
+++ b/src/lib/socket.c
@@ -86,6 +86,10 @@ int socket_v_api(void) {
 	return SOCKET_V_API;
 } /* socket_v_api() */
 
+#if LIBRESSL_VERSION_NUMBER >= 0x2050100fL
+#define HAVE_SSL_IS_SERVER 1
+#define SSL_is_server(s) (s)->server
+#endif
 
 /*
  * F E A T U R E  R O U T I N E S
