@@ -96,6 +96,22 @@ class NewContextOptions {
9696 * Toggles bypassing page's Content-Security-Policy. Defaults to {@code false}.
9797 */
9898 public Boolean bypassCSP ;
99+ /**
100+ * TLS Client Authentication allows the server to request a client certificate and verify it.
101+ *
102+ * <p> <strong>Details</strong>
103+ *
104+ * <p> An array of client certificates to be used. Each certificate object must have both {@code certPath} and {@code keyPath}
105+ * or a single {@code pfxPath} to load the client certificate. Optionally, {@code passphrase} property should be provided
106+ * if the certficiate is encrypted. The {@code origin} property should be provided with an exact match to the request
107+ * origin that the certificate is valid for.
108+ *
109+ * <p> <strong>NOTE:</strong> Using Client Certificates in combination with Proxy Servers is not supported.
110+ *
111+ * <p> <strong>NOTE:</strong> When using WebKit on macOS, accessing {@code localhost} will not pick up client certificates. You can make it work by
112+ * replacing {@code localhost} with {@code local.playwright}.
113+ */
114+ public List <ClientCertificate > clientCertificates ;
99115 /**
100116 * Emulates {@code "prefers-colors-scheme"} media feature, supported values are {@code "light"}, {@code "dark"}, {@code
101117 * "no-preference"}. See {@link com.microsoft.playwright.Page#emulateMedia Page.emulateMedia()} for more details. Passing
@@ -295,6 +311,25 @@ public NewContextOptions setBypassCSP(boolean bypassCSP) {
295311 this .bypassCSP = bypassCSP ;
296312 return this ;
297313 }
314+ /**
315+ * TLS Client Authentication allows the server to request a client certificate and verify it.
316+ *
317+ * <p> <strong>Details</strong>
318+ *
319+ * <p> An array of client certificates to be used. Each certificate object must have both {@code certPath} and {@code keyPath}
320+ * or a single {@code pfxPath} to load the client certificate. Optionally, {@code passphrase} property should be provided
321+ * if the certficiate is encrypted. The {@code origin} property should be provided with an exact match to the request
322+ * origin that the certificate is valid for.
323+ *
324+ * <p> <strong>NOTE:</strong> Using Client Certificates in combination with Proxy Servers is not supported.
325+ *
326+ * <p> <strong>NOTE:</strong> When using WebKit on macOS, accessing {@code localhost} will not pick up client certificates. You can make it work by
327+ * replacing {@code localhost} with {@code local.playwright}.
328+ */
329+ public NewContextOptions setClientCertificates (List <ClientCertificate > clientCertificates ) {
330+ this .clientCertificates = clientCertificates ;
331+ return this ;
332+ }
298333 /**
299334 * Emulates {@code "prefers-colors-scheme"} media feature, supported values are {@code "light"}, {@code "dark"}, {@code
300335 * "no-preference"}. See {@link com.microsoft.playwright.Page#emulateMedia Page.emulateMedia()} for more details. Passing
@@ -626,6 +661,22 @@ class NewPageOptions {
626661 * Toggles bypassing page's Content-Security-Policy. Defaults to {@code false}.
627662 */
628663 public Boolean bypassCSP ;
664+ /**
665+ * TLS Client Authentication allows the server to request a client certificate and verify it.
666+ *
667+ * <p> <strong>Details</strong>
668+ *
669+ * <p> An array of client certificates to be used. Each certificate object must have both {@code certPath} and {@code keyPath}
670+ * or a single {@code pfxPath} to load the client certificate. Optionally, {@code passphrase} property should be provided
671+ * if the certficiate is encrypted. The {@code origin} property should be provided with an exact match to the request
672+ * origin that the certificate is valid for.
673+ *
674+ * <p> <strong>NOTE:</strong> Using Client Certificates in combination with Proxy Servers is not supported.
675+ *
676+ * <p> <strong>NOTE:</strong> When using WebKit on macOS, accessing {@code localhost} will not pick up client certificates. You can make it work by
677+ * replacing {@code localhost} with {@code local.playwright}.
678+ */
679+ public List <ClientCertificate > clientCertificates ;
629680 /**
630681 * Emulates {@code "prefers-colors-scheme"} media feature, supported values are {@code "light"}, {@code "dark"}, {@code
631682 * "no-preference"}. See {@link com.microsoft.playwright.Page#emulateMedia Page.emulateMedia()} for more details. Passing
@@ -825,6 +876,25 @@ public NewPageOptions setBypassCSP(boolean bypassCSP) {
825876 this .bypassCSP = bypassCSP ;
826877 return this ;
827878 }
879+ /**
880+ * TLS Client Authentication allows the server to request a client certificate and verify it.
881+ *
882+ * <p> <strong>Details</strong>
883+ *
884+ * <p> An array of client certificates to be used. Each certificate object must have both {@code certPath} and {@code keyPath}
885+ * or a single {@code pfxPath} to load the client certificate. Optionally, {@code passphrase} property should be provided
886+ * if the certficiate is encrypted. The {@code origin} property should be provided with an exact match to the request
887+ * origin that the certificate is valid for.
888+ *
889+ * <p> <strong>NOTE:</strong> Using Client Certificates in combination with Proxy Servers is not supported.
890+ *
891+ * <p> <strong>NOTE:</strong> When using WebKit on macOS, accessing {@code localhost} will not pick up client certificates. You can make it work by
892+ * replacing {@code localhost} with {@code local.playwright}.
893+ */
894+ public NewPageOptions setClientCertificates (List <ClientCertificate > clientCertificates ) {
895+ this .clientCertificates = clientCertificates ;
896+ return this ;
897+ }
828898 /**
829899 * Emulates {@code "prefers-colors-scheme"} media feature, supported values are {@code "light"}, {@code "dark"}, {@code
830900 * "no-preference"}. See {@link com.microsoft.playwright.Page#emulateMedia Page.emulateMedia()} for more details. Passing
0 commit comments