Add SSL plugin to support cert (.pem) and ssl-key files for authentication to remote resource. See: http://docs.guzzlephp.org/en/latest/request-options.html#cert and http://docs.guzzlephp.org/en/latest/request-options.html#ssl-key

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alozie created an issue. See original summary.

alozie’s picture

I've created a BasicSSL plugin (BasicSSL.php) to add support for SSL authentication. It provides support for cert (.pem) and SSL key (.key) files as described by guzzle RequestOptions (see: https://api.drupal.org/api/drupal/vendor!guzzlehttp!guzzle!src!RequestOp... and https://docs.guzzlephp.org/en/latest/request-options.html).

mikeryan’s picture

Version: 8.x-3.0-beta1 » 8.x-4.x-dev
Status: Active » Needs review

Catching up on the queue at long last... Let's run this through the testbot.

heddn’s picture

Status: Needs review » Needs work
+++ b/src/Plugin/migrate_plus/authentication/BasicSSL.php
@@ -0,0 +1,32 @@
+        $this->configuration['cert']
...
+        $this->configuration['ssl_key']

There should be an exception thrown if these config keys are missing, no?

And it would help a lot if we could throw some doxygen code examples into the class comments.

Alfredo Vázquez’s picture

Update on BasicSSL file, now it throws an exception. Besides I added a Unit Testing file.

heddn’s picture

Status: Needs work » Postponed

So, I learned something in the past week or so about Drupal's http client. You can easily override it. https://www.jeffgeerling.com/blog/2016/increase-guzzle-http-client-reque... gives one example. So, I'm not sure this patch/issue is needed. Just add the guzzle overrides to settings.php for the (I assume) self-signed certs. Can you comment if that will work?