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