[CDRIVER-1409] Test that topology scanner is still async with TLS Created: 22/Jul/16  Updated: 25/Jan/18  Resolved: 25/Jan/18

Status: Closed
Project: C Driver
Component/s: tests
Affects Version/s: 1.4.0
Fix Version/s: 1.10.0

Type: New Feature Priority: Minor - P4
Reporter: A. Jesse Jiryu Davis Assignee: A. Jesse Jiryu Davis
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on CDRIVER-1956 Topology scanner's SSL handshake is b... Closed
Related
related to CDRIVER-1423 "Stream is closed" sending large mess... Closed
is related to CDRIVER-1458 Test failure in mongoc_socket check_c... Closed
is related to CDRIVER-1147 Use SSL_shutdown on OpenSSL connections? Closed
Epic Link: Native TLS and SCRAM-SHA-1

 Description   

Use the mock_server_t for end-to-end testing of the driver's topology scanner, especially that it is still async – ensuring we avoided introducing blocking code into the scanner was a focus of the native TLS code reviews (CDRIVER-749).

Now that we use SSL_shutdown on OpenSSL connections (CDRIVER-1147), the mock server must detect client-side remote shutdown, otherwise mongoc_client_destroy will hang for socketTimeoutMS when connected to mock_server_t with OpenSSL.



 Comments   
Comment by A. Jesse Jiryu Davis [ 25/Jan/18 ]

The mock server can accept SSL connections with OpenSSL, so we test that the scanner is async with OpenSSL builds.

I've manually verified that the scanner is async with Windows SChannel, but I won't implement the server side of SSL with SChannel in the mock server.

Apple Secure Transport is still blocking; that's ok so long as programmers only use Mac OS X for development, not deployment.

Comment by Githook User [ 06/Jan/18 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis', 'email': 'jesse@mongodb.com'}

Message: CDRIVER-1409 test openssl handshake is async, 2
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/aa0f6974d72e3981cb5df0881ff71991e9e5c3b5

Comment by Githook User [ 05/Jan/18 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis', 'email': 'jesse@mongodb.com'}

Message: CDRIVER-1409 test that openssl handshake is async
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/51fd187bc76fce3ed8715baa773e92726340ef13

Comment by A. Jesse Jiryu Davis [ 09/Aug/16 ]

I have a test in my local checkout that proves what we want to prove. It works with OpenSSL, and works with Secure Transport (Apple) for up to 8 mock servers, but hangs with 9. Haven't tried Secure Channel (Windows) at all.

Comment by Githook User [ 09/Aug/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: Revert "CDRIVER-1409 test that TLS scanner is async"

This reverts commit 8642ac1a6dd26cc265fbd25c35d7134a21deb0ae.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/ded4667adf36b003b998d2795412fc7c034af255

Comment by Githook User [ 31/Jul/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-1409 openssl_check_closed was always true

BIO_get_shutdown doesn't do what I thought: it doesn't check whether the
socket has been closed, it returns the state of a config flag, which
was always true. Caused /Client/exhaust_cursor/single tests to fail
with "error: connection closed".

It was only this test that failed because the driver only calls
check_closed in single-client mode on a socket idle for 1 second, and
only since #3c81f4f6 does this test pause a full second.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/a9739598717eb82a214b7d3fbf922b666f7b345e

Comment by Githook User [ 27/Jul/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-1409 better style in test
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/1400057ebc1dec21419314a3f4af8bb03ce6298b

Comment by Githook User [ 22/Jul/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-1409 test that TLS scanner is async

Also detect remote TLS shutdown: Only matters for the server sockets we
use in TLS tests; in production it is the driver that shuts down TLS
connections.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/8642ac1a6dd26cc265fbd25c35d7134a21deb0ae

Generated at Wed Feb 07 21:12:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.