@@ -447,4 +447,69 @@ 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+ Http::HttpClientConnectionOptions connectionOptions;
492+ connectionOptions.Bootstrap = &clientBootstrap;
493+ connectionOptions.SocketOptions = socketOptions;
494+ connectionOptions.TlsOptions = tlsConnectionOptions;
495+ connectionOptions.HostName = String ((const char *)hostName.ptr , hostName.len );
496+ connectionOptions.Port = 443 ;
497+
498+ Http::HttpClientConnectionManagerOptions connectionManagerOptions;
499+ connectionManagerOptions.ConnectionOptions = connectionOptions;
500+ connectionManagerOptions.MaxConnections = 30 ;
501+ connectionManagerOptions.EnableBlockingShutdown = true ;
502+
503+ Vector<ByteCursor> networkInterfaces{ByteCursorFromCString (" eth0" ), ByteCursorFromCString (" eth1" )};
504+ connectionManagerOptions.NetworkInterfaces = networkInterfaces;
505+
506+ auto connectionManager =
507+ Http::HttpClientConnectionManager::NewClientConnectionManager (connectionManagerOptions, allocator);
508+ ASSERT_TRUE (connectionManager);
509+ }
510+ return AWS_OP_SUCCESS;
511+ }
512+
513+ AWS_TEST_CASE (HttpClientCreateManagerWithNetworkInterfacesList, s_TestHttpClientCreateManagerWithNetworkInterfacesList)
514+
450515#endif // !BYO_CRYPTO
0 commit comments