Skip to content

Commit a215a93

Browse files
authored
Merge pull request #114 from cvette/feat/cv-tls-options
feat: add SSL configuration options
2 parents 7a8a85f + 07b4c69 commit a215a93

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

Classes/Transfer/RequestService.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,23 @@ public function initializeObject()
6969
$requestEngine->setOption(CURLOPT_TIMEOUT, $this->settings['transfer']['connectionTimeout']);
7070
$requestEngine->setOption(CURLOPT_SSL_VERIFYPEER, $this->settings['transfer']['sslVerifyPeer'] ?? true ? 2 : 0);
7171
$requestEngine->setOption(CURLOPT_SSL_VERIFYHOST, $this->settings['transfer']['sslVerifyHost'] ?? true ? 2 : 0);
72+
73+
if (!empty($this->settings['transfer']['sslCaInfo'])) {
74+
$requestEngine->setOption(CURLOPT_CAINFO, $this->settings['transfer']['sslCaInfo']);
75+
}
76+
77+
if (!empty($this->settings['transfer']['sslKey'])) {
78+
$requestEngine->setOption(CURLOPT_SSLKEY, $this->settings['transfer']['sslKey']);
79+
}
80+
81+
if (!empty($this->settings['transfer']['sslCert'])) {
82+
$requestEngine->setOption(CURLOPT_SSLCERT, $this->settings['transfer']['sslCert']);
83+
}
84+
85+
if (!empty($this->settings['transfer']['sslKeyPasswd'])) {
86+
$requestEngine->setOption(CURLOPT_SSLKEYPASSWD, $this->settings['transfer']['sslKeyPasswd']);
87+
}
88+
7289
$this->browser->setRequestEngine($requestEngine);
7390
}
7491

Configuration/Settings.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ Flowpack:
1515
connectionTimeout: 60
1616
sslVerifyPeer: true
1717
sslVerifyHost: true
18+
sslCaInfo: ''
19+
sslCert: ''
20+
sslKey: ''
21+
sslKeyPasswd: ''
1822
Neos:
1923
Flow:
2024
persistence:

Documentation/Index.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,23 @@ and password in your client settings::
4747
username: john
4848
password: mysecretpassword
4949

50+
The following options are available to configure TLS connections. These correspond to the options provided by cURL::
51+
52+
sslVerifyHost: true
53+
sslVerifyPeer: true
54+
55+
# CA certificate to verify the peer with
56+
sslCaInfo: './root-ca.pem'
57+
58+
# file containing the private SSL key
59+
sslKey: './client-key.pem'
60+
61+
# file containing the PEM formatted certificate
62+
sslCert: './client.pem'
63+
64+
# password needed for the private SSL key
65+
sslKeyPasswd: 'some-password'
66+
5067
Running the Functional Tests
5168
============================
5269

0 commit comments

Comments
 (0)