Skip to content
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "envoy"]
path = envoy
url = https://github.com/envoyproxy/envoy.git
url = https://github.com/jpsim/envoy.git

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for testing purposes, will revert before merging.

2 changes: 1 addition & 1 deletion envoy
Submodule envoy updated from edf0ce to cff0d1
7 changes: 5 additions & 2 deletions library/objective-c/EnvoyConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ - (instancetype)initWithAdminInterfaceEnabled:(BOOL)adminInterfaceEnabled
enableHappyEyeballs:(BOOL)enableHappyEyeballs
enableInterfaceBinding:(BOOL)enableInterfaceBinding
enforceTrustChainVerification:(BOOL)enforceTrustChainVerification
includeUnroutableFamilies:(BOOL)includeUnroutableFamilies
h2ConnectionKeepaliveIdleIntervalMilliseconds:
(UInt32)h2ConnectionKeepaliveIdleIntervalMilliseconds
h2ConnectionKeepaliveTimeoutSeconds:(UInt32)h2ConnectionKeepaliveTimeoutSeconds
Expand Down Expand Up @@ -53,6 +54,7 @@ - (instancetype)initWithAdminInterfaceEnabled:(BOOL)adminInterfaceEnabled
self.enableHappyEyeballs = enableHappyEyeballs;
self.enableInterfaceBinding = enableInterfaceBinding;
self.enforceTrustChainVerification = enforceTrustChainVerification;
self.includeUnroutableFamilies = includeUnroutableFamilies;
self.h2ConnectionKeepaliveIdleIntervalMilliseconds =
h2ConnectionKeepaliveIdleIntervalMilliseconds;
self.h2ConnectionKeepaliveTimeoutSeconds = h2ConnectionKeepaliveTimeoutSeconds;
Expand Down Expand Up @@ -145,11 +147,12 @@ - (nullable NSString *)resolveTemplate:(NSString *)templateYAML {
self.enableHappyEyeballs ? @"true" : @"false"];
[definitions appendFormat:@"- &dns_refresh_rate %lus\n", (unsigned long)self.dnsRefreshSeconds];
[definitions appendFormat:@"- &dns_resolver_name envoy.network.dns_resolver.apple\n"];
// No additional values are currently needed for Apple-based DNS resolver.
[definitions
appendFormat:@"- &dns_resolver_config "
@"{\"@type\":\"type.googleapis.com/"
@"envoy.extensions.network.dns_resolver.apple.v3.AppleDnsResolverConfig\"}\n"];
@"envoy.extensions.network.dns_resolver.apple.v3.AppleDnsResolverConfig\", "
@"\"include_unroutable_families\": %@}\n",
self.includeUnroutableFamilies ? @"true" : @"false"];
[definitions appendFormat:@"- &enable_interface_binding %@\n",
self.enableInterfaceBinding ? @"true" : @"false"];
[definitions appendFormat:@"- &trust_chain_verification %@\n", self.enforceTrustChainVerification
Expand Down
2 changes: 2 additions & 0 deletions library/objective-c/EnvoyEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ extern const int kEnvoyFilterResumeStatusResumeIteration;
@property (nonatomic, assign) BOOL enableHappyEyeballs;
@property (nonatomic, assign) BOOL enableInterfaceBinding;
@property (nonatomic, assign) BOOL enforceTrustChainVerification;
@property (nonatomic, assign) BOOL includeUnroutableFamilies;
@property (nonatomic, assign) UInt32 h2ConnectionKeepaliveIdleIntervalMilliseconds;
@property (nonatomic, assign) UInt32 h2ConnectionKeepaliveTimeoutSeconds;
@property (nonatomic, strong) NSArray<NSString *> *h2RawDomains;
Expand Down Expand Up @@ -372,6 +373,7 @@ extern const int kEnvoyFilterResumeStatusResumeIteration;
enableHappyEyeballs:(BOOL)enableHappyEyeballs
enableInterfaceBinding:(BOOL)enableInterfaceBinding
enforceTrustChainVerification:(BOOL)enforceTrustChainVerification
includeUnroutableFamilies:(BOOL)includeUnroutableFamilies
h2ConnectionKeepaliveIdleIntervalMilliseconds:
(UInt32)h2ConnectionKeepaliveIdleIntervalMilliseconds
h2ConnectionKeepaliveTimeoutSeconds:(UInt32)h2ConnectionKeepaliveTimeoutSeconds
Expand Down
15 changes: 15 additions & 0 deletions library/swift/EngineBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ open class EngineBuilder: NSObject {
private var enableHappyEyeballs: Bool = false
private var enableInterfaceBinding: Bool = false
private var enforceTrustChainVerification: Bool = true
private var includeUnroutableFamilies: Bool = false
private var h2ConnectionKeepaliveIdleIntervalMilliseconds: UInt32 = 100000000
private var h2ConnectionKeepaliveTimeoutSeconds: UInt32 = 10
private var h2RawDomains: [String] = []
Expand Down Expand Up @@ -186,6 +187,19 @@ open class EngineBuilder: NSObject {
return self
}

/// Specify whether DNS addresses that the system considers to be unroutable should still
/// be attempted.
///
/// - parameter includeUnroutableFamilies: whether to include unroutable families of DNS
/// addresses.
///
/// - returns: This builder.
@discardableResult
public func includeUnroutableFamilies(_ includeUnroutableFamilies: Bool) -> Self {
self.includeUnroutableFamilies = includeUnroutableFamilies
return self
}

/// Add a rate at which to ping h2 connections on new stream creation if the connection has
/// sat idle.
///
Expand Down Expand Up @@ -430,6 +444,7 @@ open class EngineBuilder: NSObject {
enableHappyEyeballs: self.enableHappyEyeballs,
enableInterfaceBinding: self.enableInterfaceBinding,
enforceTrustChainVerification: self.enforceTrustChainVerification,
includeUnroutableFamilies: self.includeUnroutableFamilies,
h2ConnectionKeepaliveIdleIntervalMilliseconds:
self.h2ConnectionKeepaliveIdleIntervalMilliseconds,
h2ConnectionKeepaliveTimeoutSeconds: self.h2ConnectionKeepaliveTimeoutSeconds,
Expand Down
3 changes: 3 additions & 0 deletions test/swift/EngineBuilderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ final class EngineBuilderTests: XCTestCase {
enableHappyEyeballs: true,
enableInterfaceBinding: true,
enforceTrustChainVerification: false,
includeUnroutableFamilies: false,
h2ConnectionKeepaliveIdleIntervalMilliseconds: 1,
h2ConnectionKeepaliveTimeoutSeconds: 333,
h2RawDomains: ["h2-raw.domain"],
Expand Down Expand Up @@ -494,6 +495,7 @@ final class EngineBuilderTests: XCTestCase {
enableHappyEyeballs: false,
enableInterfaceBinding: false,
enforceTrustChainVerification: true,
includeUnroutableFamilies: true,
h2ConnectionKeepaliveIdleIntervalMilliseconds: 1,
h2ConnectionKeepaliveTimeoutSeconds: 333,
h2RawDomains: [],
Expand Down Expand Up @@ -535,6 +537,7 @@ final class EngineBuilderTests: XCTestCase {
enableHappyEyeballs: false,
enableInterfaceBinding: false,
enforceTrustChainVerification: true,
includeUnroutableFamilies: true,
h2ConnectionKeepaliveIdleIntervalMilliseconds: 222,
h2ConnectionKeepaliveTimeoutSeconds: 333,
h2RawDomains: [],
Expand Down