Skip to content

Commit 57c0540

Browse files
Add W3C acceptInsecureCerts Capability and set default to true
1 parent c19bba0 commit 57c0540

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

dotnet/src/webdriver/Remote/CapabilityType.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ public static class CapabilityType
7373
/// </summary>
7474
public static readonly string AcceptSslCertificates = "acceptSslCerts";
7575

76+
/// <summary>
77+
/// Capability name used to indicate whether the browser accepts SSL certificates on W3C Endpoints
78+
/// </summary>
79+
public static readonly string AcceptInsecureCertificates = "acceptInsecureCerts";
80+
7681
/// <summary>
7782
/// Capability name used to indicate whether the browser uses native events.
7883
/// </summary>

dotnet/src/webdriver/Remote/DesiredCapabilities.cs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,28 @@ public bool IsJavaScriptEnabled
161161
}
162162
}
163163

164+
/// <summary>
165+
/// Gets or sets a value indicating whether the browser accepts SSL certificates.
166+
/// </summary>
167+
public bool AcceptInsecureCerts
168+
{
169+
get
170+
{
171+
bool acceptSSLCerts = false;
172+
object capabilityValue = this.GetCapability(CapabilityType.AcceptInsecureCertificates);
173+
if (capabilityValue != null)
174+
{
175+
acceptSSLCerts = (bool)capabilityValue;
176+
}
177+
return acceptSSLCerts;
178+
}
179+
180+
set
181+
{
182+
this.SetCapability(CapabilityType.AcceptInsecureCertificates, value);
183+
}
184+
}
185+
164186
/// <summary>
165187
/// Gets the internal capabilities dictionary.
166188
/// </summary>
@@ -175,7 +197,9 @@ internal Dictionary<string, object> CapabilitiesDictionary
175197
/// <returns>New instance of DesiredCapabilities for use with Firefox</returns>
176198
public static DesiredCapabilities Firefox()
177199
{
178-
return new DesiredCapabilities("firefox", string.Empty, new Platform(PlatformType.Any));
200+
DesiredCapabilities dc = new DesiredCapabilities("firefox", string.Empty, new Platform(PlatformType.Any))
201+
dc.AcceptInsecureCerts = true;
202+
return dc;
179203
}
180204

181205
/// <summary>

0 commit comments

Comments
 (0)