Skip to content
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

Skip SSL verification #19

Open
thekid opened this issue Jun 28, 2016 · 1 comment
Open

Skip SSL verification #19

thekid opened this issue Jun 28, 2016 · 1 comment
Labels

Comments

@thekid
Copy link
Member

thekid commented Jun 28, 2016

Currently only possible via:

index 6cd14dc..b732637 100644
--- a/src/main/php/peer/http/SSLSocketHttpTransport.class.php
+++ b/src/main/php/peer/http/SSLSocketHttpTransport.class.php
@@ -21,11 +21,14 @@ class SSLSocketHttpTransport extends SocketHttpTransport {
    */
   protected function newSocket(\peer\URL $url, $arg) {
     if ('tls' === $arg) {
-      return new TLSSocket($url->getHost(), $url->getPort(443), null);
+      $s= new TLSSocket($url->getHost(), $url->getPort(443), null);
     } else {
       sscanf($arg, 'v%d', $version);
-      return new SSLSocket($url->getHost(), $url->getPort(443), null, $version);
+      $s= new SSLSocket($url->getHost(), $url->getPort(443), null, $version);
     }
+    $s->setVerifyPeer(false);
+    $s->setAllowSelfSigned(false);
+    return $s;
   }

(plus a couple more tweeks for proxy setups)

Especially for testing against self-signed certificates, this can be tedious. Maybe passing https+unverified://example.com/ can make this easier but not compromise default security

/cc @kiesel

@kiesel
Copy link
Member

kiesel commented Jul 27, 2016

👍 for this - for development this is often necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants