Skip to content

Commit e2edf72

Browse files
Check if server supports OOB check at connect (#419).
1 parent 368cbfb commit e2edf72

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

doc/src/release_notes.rst

+6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ Thin Mode Changes
2020
#) Perform TLS server matching in python-oracledb instead of the Python SSL
2121
library to allow alternate names to be checked
2222
(`issue 415 <https://github.com/oracle/python-oracledb/issues/415>`__).
23+
#) If the database states that an out-of-band break check should not take place
24+
during connect (by setting the `DISABLE_OOB_AUTO
25+
<https://www.oracle.com/pls/topic/lookup?ctx=dblatest&
26+
id=GUID-490A0B3B-FEF3-425A-81B0-6FA29D4B8C0E>`__ parameter to TRUE),
27+
python-oracledb no longer attempts to do so
28+
(`issue 419 <https://github.com/oracle/python-oracledb/issues/419>`__).
2329
#) Error ``DPY-6002: The distinguished name (DN) on the server certificate
2430
does not match the expected value: "{expected_dn}"`` now shows the expected
2531
value.

src/oracledb/impl/thin/capabilities.pyx

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ cdef class Capabilities:
4141
uint32_t max_string_size
4242
bint supports_fast_auth
4343
bint supports_oob
44+
bint supports_oob_check
4445
bint supports_end_of_response
4546
bint supports_pipelining
4647
uint32_t sdu
@@ -60,6 +61,8 @@ cdef class Capabilities:
6061
self.supports_oob = protocol_options & TNS_GSO_CAN_RECV_ATTENTION
6162
if flags & TNS_ACCEPT_FLAG_FAST_AUTH:
6263
self.supports_fast_auth = True
64+
if flags & TNS_ACCEPT_FLAG_CHECK_OOB:
65+
self.supports_oob_check = True
6366
if protocol_version >= TNS_VERSION_MIN_END_OF_RESPONSE:
6467
if flags & TNS_ACCEPT_FLAG_HAS_END_OF_RESPONSE:
6568
self.compile_caps[TNS_CCAP_TTC4] |= TNS_CCAP_END_OF_RESPONSE

src/oracledb/impl/thin/constants.pxi

+1
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,7 @@ cdef enum:
762762

763763
# accept flags
764764
cdef enum:
765+
TNS_ACCEPT_FLAG_CHECK_OOB = 0x00000001
765766
TNS_ACCEPT_FLAG_FAST_AUTH = 0x10000000
766767
TNS_ACCEPT_FLAG_HAS_END_OF_RESPONSE = 0x02000000
767768

src/oracledb/impl/thin/protocol.pyx

+1-2
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,7 @@ cdef class Protocol(BaseProtocol):
289289

290290
# if we can use OOB, send an urgent message now followed by a reset
291291
# marker to see if the server understands it
292-
if self._caps.supports_oob \
293-
and self._caps.protocol_version >= TNS_VERSION_MIN_OOB_CHECK:
292+
if self._caps.supports_oob and self._caps.supports_oob_check:
294293
self._transport.send_oob_break()
295294
self._send_marker(self._write_buf, TNS_MARKER_TYPE_RESET)
296295

0 commit comments

Comments
 (0)