@@ -40,8 +40,6 @@ public function isSupported() {
40
40
public function send (ApiClient $ apiClient , HttpRequest $ request ) {
41
41
$ curl = curl_init ();
42
42
43
- $ tempCAFile = sys_get_temp_dir () . DIRECTORY_SEPARATOR . "PostFinance Checkout-ca-bundle.crt " ;
44
-
45
43
// set timeout, if needed
46
44
if ($ request ->getTimeOut () !== 0 ) {
47
45
curl_setopt ($ curl , CURLOPT_TIMEOUT , $ request ->getTimeOut ());
@@ -61,11 +59,6 @@ public function send(ApiClient $apiClient, HttpRequest $request) {
61
59
} else {
62
60
curl_setopt ($ curl , CURLOPT_SSL_VERIFYPEER , true );
63
61
curl_setopt ($ curl , CURLOPT_SSL_VERIFYHOST , 2 );
64
- if (file_exists ($ tempCAFile )) {
65
- // use the temporal CA Bundle if it was set, which indicates a previous error.
66
- $ apiClient ->setCertificateAuthority ($ tempCAFile );
67
- curl_setopt ($ curl , CURLOPT_CAINFO , $ apiClient ->getCertificateAuthority ());
68
- }
69
62
}
70
63
71
64
if ($ request ->getMethod () === HttpRequest::POST ) {
@@ -109,19 +102,8 @@ public function send(ApiClient $apiClient, HttpRequest $request) {
109
102
110
103
// Make the request
111
104
$ response = curl_exec ($ curl );
112
- if ($ response ) {
113
- $ response = $ this ->handleResponse ($ apiClient , $ request , $ curl , $ response , $ request ->getUrl ());
114
- } else {
115
- // if there was an error, try again with the CA bundle provided by this SDK.
116
- $ caContent = file_get_contents (__DIR__ . DIRECTORY_SEPARATOR . ".. " . DIRECTORY_SEPARATOR . "ca-bundle.crt " );
117
- file_put_contents ($ tempCAFile , $ caContent );
118
-
119
- // Try again the request, this time with the CA bundle provided by this SDK.
120
- $ apiClient ->setCertificateAuthority ($ tempCAFile );
121
- curl_setopt ($ curl , CURLOPT_CAINFO , $ apiClient ->getCertificateAuthority ());
122
- $ response = curl_exec ($ curl );
123
- $ response = $ this ->handleResponse ($ apiClient , $ request , $ curl , $ response , $ request ->getUrl ());
124
- }
105
+
106
+ $ response = $ this ->handleResponse ($ apiClient , $ request , $ curl , $ response , $ request ->getUrl ());
125
107
126
108
curl_close ($ curl );
127
109
fclose ($ debugFilePointer );
0 commit comments