PQsetNoticeReceiver.restype = PQnoticeReceiver
+# 33.18. SSL Support
+
+PQinitOpenSSL = pq.PQinitOpenSSL
+PQinitOpenSSL.argtypes = [c_int, c_int]
+PQinitOpenSSL.restype = None
+
+
def generate_stub() -> None:
import re
from ctypes import _CFuncPtr
def PQputCopyData(arg1: Optional[PGconn_struct], arg2: bytes, arg3: int) -> int: ...
def PQfreemem(arg1: Any) -> None: ...
def PQmakeEmptyPGresult(arg1: Optional[PGconn_struct], arg2: int) -> PGresult_struct: ...
+def PQinitOpenSSL(arg1: int, arg2: int) -> None: ...
# autogenerated: end
# fmt: on
rv = string_at(out, len_out.value)
impl.PQfreemem(out)
return memoryview(rv)
+
+
+# importing the ssl module sets up Python's libcrypto callbacks
+import ssl # noqa
+
+# disable libcrypto setup in libpq, so it won't stomp on the callbacks
+# that have already been set up
+impl.PQinitOpenSSL(1, 0)
include "pq/conninfo.pyx"
include "pq/escaping.pyx"
include "pq/pqbuffer.pyx"
+
+
+# importing the ssl module sets up Python's libcrypto callbacks
+import ssl # noqa
+
+# disable libcrypto setup in libpq, so it won't stomp on the callbacks
+# that have already been set up
+libpq.PQinitOpenSSL(1, 0)
# Copyright (C) 2020-2021 The Psycopg Team
cdef extern from "libpq-fe.h":
- int PQlibVersion()
# structures and types
ctypedef void (*PQnoticeReceiver)(void *arg, const PGresult *res)
PQnoticeReceiver PQsetNoticeReceiver(
PGconn *conn, PQnoticeReceiver prog, void *arg)
+
+ # 33.18. SSL Support
+ void PQinitOpenSSL(int do_ssl, int do_crypto)