Skip to content

Commit ba93f92

Browse files
committed
add option "ignoreCertificateErrors"
1 parent 96228f8 commit ba93f92

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
* Added method ``Page::addPreScript``
2323
* Added option ``"nosandbox"`` for browser factory
2424
* Added option ``"sendSyncDefaultTimeout"`` for browser factory
25+
* Added option ``"ignoreCertificateErrors"`` for browser factory
2526
* Bug fixes:
2627
* Fixed user agent string for browser factory
2728

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ Here are the options available for the browser factory:
134134
| debugLogger | null | A string (e.g "php://stdout"), or resource, or PSR-3 logger instance to print debug messages |
135135
| enableImages | true | Toggles loading of images |
136136
| headless | true | Enable or disable headless mode |
137+
| ignoreCertificateErrors | false | Set chrome to ignore ssl errors |
137138
| noSandbox | false | Useful to run in a docker container |
138139
| sendSyncDefaultTimeout | 3000 | Default timeout (ms) for sending sync messages |
139140
| startupTimeout | 30 | Maximum time in seconds to wait for chrome to start |

src/Browser/BrowserProcess.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,11 @@ private function getArgsFromOptions(array $options)
328328
$args[] = '--user-agent=' . escapeshellarg($options['userAgent']);
329329
}
330330

331+
// ignore certificate errors
332+
if (array_key_exists('ignoreCertificateErrors', $options) && $options['ignoreCertificateErrors']) {
333+
$args[] = '--ignore-certificate-errors';
334+
}
335+
331336
// add user data dir to args
332337
$args[] = '--user-data-dir=' . $options['userDataDir'];
333338

src/BrowserFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public function __construct(string $chromeBinaries = null)
4040
* enabling debug logger will also enable debug mode.
4141
* - enableImages: toggle the loading of images (default: true)
4242
* - headless: whether chrome should be started headless (default: true)
43+
* - ignoreCertificateErrors: set chrome to ignore ssl errors
4344
* - noSandbox: enable no sandbox mode (default: false)
4445
* - sendSyncDefaultTimeout: maximum time in ms to wait for synchronous messages to send (default 3000 ms)
4546
* - startupTimeout: maximum time in seconds to wait for chrome to start (default: 30 sec)

0 commit comments

Comments
 (0)