@@ -447,4 +447,76 @@ AWS_TEST_CASE(
447447 HttpClientConnectionWithPendingAcquisitionsAndClosedConnections,
448448 s_TestHttpClientConnectionWithPendingAcquisitionsAndClosedConnections)
449449
450+ static int s_TestHttpClientCreateManagerWithNetworkInterfacesList(struct aws_allocator *allocator, void *ctx)
451+ {
452+ (void )ctx;
453+ {
454+ Aws::Crt::ApiHandle apiHandle (allocator);
455+
456+ Aws::Crt::Io::TlsContextOptions tlsCtxOptions = Aws::Crt::Io::TlsContextOptions::InitDefaultClient ();
457+
458+ // Ensure that if PQ TLS ciphers are supported on the current platform, that setting them works when connecting
459+ // to S3. This TlsCipherPreference has post quantum ciphers at the top of it's preference list (that will be
460+ // ignored if S3 doesn't support them) followed by regular TLS ciphers that can be chosen and negotiated by S3.
461+ aws_tls_cipher_pref tls_cipher_pref = AWS_IO_TLS_CIPHER_PREF_PQ_DEFAULT;
462+
463+ if (aws_tls_is_cipher_pref_supported (tls_cipher_pref))
464+ {
465+ tlsCtxOptions.SetTlsCipherPreference (tls_cipher_pref);
466+ }
467+
468+ Aws::Crt::Io::TlsContext tlsContext (tlsCtxOptions, Aws::Crt::Io::TlsMode::CLIENT, allocator);
469+ ASSERT_TRUE (tlsContext);
470+
471+ Aws::Crt::Io::TlsConnectionOptions tlsConnectionOptions = tlsContext.NewConnectionOptions ();
472+
473+ ByteCursor cursor = ByteCursorFromCString (" https://s3.amazonaws.com" );
474+ Io::Uri uri (cursor, allocator);
475+
476+ auto hostName = uri.GetHostName ();
477+ tlsConnectionOptions.SetServerName (hostName);
478+
479+ Aws::Crt::Io::SocketOptions socketOptions;
480+ socketOptions.SetConnectTimeoutMs (10000 );
481+
482+ Aws::Crt::Io::EventLoopGroup eventLoopGroup (1 , allocator);
483+ ASSERT_TRUE (eventLoopGroup);
484+
485+ Aws::Crt::Io::DefaultHostResolver defaultHostResolver (eventLoopGroup, 8 , 30 , allocator);
486+ ASSERT_TRUE (defaultHostResolver);
487+
488+ Aws::Crt::Io::ClientBootstrap clientBootstrap (eventLoopGroup, defaultHostResolver, allocator);
489+ ASSERT_TRUE (clientBootstrap);
490+ clientBootstrap.EnableBlockingShutdown ();
491+
492+ std::condition_variable semaphore;
493+ std::mutex semaphoreLock;
494+ size_t connectionCount = 0 ;
495+ size_t connectionsFailed = 0 ;
496+ size_t totalExpectedConnections = 30 ;
497+
498+ Http::HttpClientConnectionOptions connectionOptions;
499+ connectionOptions.Bootstrap = &clientBootstrap;
500+ connectionOptions.SocketOptions = socketOptions;
501+ connectionOptions.TlsOptions = tlsConnectionOptions;
502+ connectionOptions.HostName = String ((const char *)hostName.ptr , hostName.len );
503+ connectionOptions.Port = 443 ;
504+
505+ Http::HttpClientConnectionManagerOptions connectionManagerOptions;
506+ connectionManagerOptions.ConnectionOptions = connectionOptions;
507+ connectionManagerOptions.MaxConnections = totalExpectedConnections;
508+ connectionManagerOptions.EnableBlockingShutdown = true ;
509+
510+ Vector<ByteCursor> networkInterfaces{ByteCursorFromCString (" eth0" ), ByteCursorFromCString (" eth1" )};
511+ connectionManagerOptions.NetworkInterfaces = networkInterfaces;
512+
513+ auto connectionManager =
514+ Http::HttpClientConnectionManager::NewClientConnectionManager (connectionManagerOptions, allocator);
515+ ASSERT_TRUE (connectionManager);
516+ }
517+ return AWS_OP_SUCCESS;
518+ }
519+
520+ AWS_TEST_CASE (HttpClientCreateManagerWithNetworkInterfacesList, s_TestHttpClientCreateManagerWithNetworkInterfacesList)
521+
450522#endif // !BYO_CRYPTO
0 commit comments