-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting up Org Connection with custom SSL certificates in Drupal 8 #224
Comments
Hi @aditya1316, Indeed, there is no hook for that in Drupal 8. Although, the module uses Drupal 8's built-in HTTP client (which is Guzzle 6) so the simplest and easiest way to register your custom SSL certificate is adding it to the settings.php file like this:
This will register your SSL certificates and adds it to all HTTP requests. More details: If you would like to register an SSL certificate only for the Apigee Edge API calls you can decorate the SdkConnector service. |
Thanks @mxr576 , I tried adding $settings['http_client_config']['cert'] in settings.php , so now different error is showing up i.e. "Failed to connect to Apigee Edge. Error message: cURL error 58: (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)". I added $settings['http_client_config']['cert'] = 'ABS Path/abc.pem' and $settings['http_client_config']['key'] = 'ABS Path/abc.key'. |
'key' is not a valid Guzzle configuration option: http://docs.guzzlephp.org/en/stable/request-options.html |
You can find a different approach in #120 where the certificate got registered in the PHP configuration. |
Just FYI |
@aditya1316 from the problem description it appears to me that you have configured TLS for the management API but with a self signed certificate. In this case, you can add the following to the php.ini file: and restart the webserver. Note: The hostname used in the management url should match with the certificate, else you will see cURL error 51: (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) . Let me know if this helps. |
Yes @arunz6161 . We have configured TLS for the Management API. As in Drupal 7 , we have altered the hook "devconnect_org_settings" to add certs and key as an array .So if there any hook in Drupal 8 through which we can pass the certs? |
@aditya1316 There is no alter hook and you do not them. I already provided an application level solution. Yesterday you added this to the settings.php: $settings['http_client_config']['cert'] = 'ABS Path/abc.pem'
$settings['http_client_config']['key'] = 'ABS Path/abc.key'. and I highlighted that there is no https://stackoverflow.com/a/49590036 |
@aditya1316 Have you managed to solve this? |
@mxr576 I tried with below code but it didn't worked Getting below error Debug Information:- { |
@aditya1316 I followed the steps provided by Dezso on this issue and got it working. So that makes me believe this is a configuration issue. Error message: cURL error 58: (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)- indicates a client certificate error, so can you validate if the key file is in pem format and validate if you are using a protected private key. Another good test you can run is to make a management API call via curl using the same cert and key : For reference here are the settings i used : $settings['http_client_config']['cert'] = '/etc/httpd/conf.d/demo-client.cert.pem'; Note: You don't need the |
We should document these steps . |
Thanks Guyz. |
Hi Team ,
Can you please help in setting up Org Connection in Devportal(Drupal 8) with custom SSL Certs?
In Drupal 7 we have altered the hook devconnect_org_settings and added custom certifficates as 'http_options' , but i couldn't find the hook to alter the org settings in Drupal 8.
The text was updated successfully, but these errors were encountered: