66//
77
88import struct Foundation. TimeInterval
9+ import AwsCommonRuntimeKit
910
1011public class HttpClientConfiguration {
1112
12- /// The timeout for a request , in seconds.
13+ /// The timeout for establishing a connection , in seconds.
1314 ///
1415 /// If none is provided, the client will use default values based on the platform.
1516 public var connectTimeout : TimeInterval ?
1617
18+ /// The timeout for socket, in seconds.
19+ /// Sets maximum time to wait between two data packets.
20+ /// Used to close stale connections that have no activity.
21+ ///
22+ /// Defaults to 60 seconds if no value is provided.
23+ public var socketTimeout : TimeInterval
24+
1725 /// HTTP headers to be submitted with every HTTP request.
1826 ///
1927 /// If none is provided, defaults to no extra headers.
@@ -27,21 +35,33 @@ public class HttpClientConfiguration {
2735 /// If none is provided, the default protocol for the operation will be used
2836 public var protocolType : ProtocolType ?
2937
38+ /// Custom TLS configuration for HTTPS connections.
39+ ///
40+ /// Enables specifying client certificates and trust stores for secure communication.
41+ /// Defaults to system's TLS settings if `nil`.
42+ public var tlsConfiguration : ( any TLSConfiguration ) ?
43+
3044 /// Creates a configuration object for a SDK HTTP client.
3145 ///
3246 /// Not all configuration settings may be followed by all clients.
3347 /// - Parameters:
34- /// - connectTimeout: The maximum time to wait for a response without receiving any data.
48+ /// - connectTimeout: The maximum time to wait for a connection to be established.
49+ /// - socketTimeout: The maximum time to wait between data packets.
3550 /// - defaultHeaders: HTTP headers to be included with every HTTP request.
3651 /// Note that certain headers may cause your API request to fail. Defaults to no headers.
3752 /// - protocolType: The HTTP scheme (`http` or `https`) to be used for API requests. Defaults to the operation's standard configuration.
53+ /// - tlsConfiguration: Optional custom TLS configuration for HTTPS requests. If `nil`, defaults to a standard configuration.
3854 public init (
3955 connectTimeout: TimeInterval ? = nil ,
56+ socketTimeout: TimeInterval = 60.0 ,
4057 protocolType: ProtocolType = . https,
41- defaultHeaders: Headers = Headers ( )
58+ defaultHeaders: Headers = Headers ( ) ,
59+ tlsConfiguration: ( any TLSConfiguration ) ? = nil
4260 ) {
61+ self . socketTimeout = socketTimeout
4362 self . protocolType = protocolType
4463 self . defaultHeaders = defaultHeaders
4564 self . connectTimeout = connectTimeout
65+ self . tlsConfiguration = tlsConfiguration
4666 }
4767}
0 commit comments