Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

[SSL/TLS] Support for pass the stream context #84

Open
gongo opened this issue Apr 25, 2016 · 5 comments
Open

[SSL/TLS] Support for pass the stream context #84

gongo opened this issue Apr 25, 2016 · 5 comments

Comments

@gongo
Copy link

gongo commented Apr 25, 2016

From PHP 5.6, SSL/TLS client streams now enable peer verification by default.
So, error occurs when communicate with the server that is using a self-signed certificate.

See: http://php.net/manual/migration56.openssl.php

In order to avoid the above problem:

$options = [
    'ssl' => [
        'verify_peer_name' => false,
        'verify_peer'      => false,
    ]
];

$context = stream_context_create($options);

// ex. https://github.com/zendframework/zend-mail/blob/release-2.7.0/src/Protocol/Pop3.php#L95

// $this->socketfsockopen($host, $port, $errno, $errstr, self::TIMEOUT_CONNECTION);
$this->socketfsockopen($host, $port, $errno, $errstr, self::TIMEOUT_CONNECTION, $context);

In this way, there is a need to pass a stream context to the stream function.

However, the current Zend\Mail\Protocol\Pop3 and Zend\Mail\Protocol\Smtp look like does not provide an interface to pass stream context.
Is there support for the above interface in future?


A similar way: zend-http/zend.http.client.adapters.md at release-2.5.4 · zendframework/zend-http

@Cruiser13
Copy link

I created a fork which solves this issue hard-coded here: https://github.com/Cruiser13/zend-mail
I don't think they'll add a config solution inside the core since ZF1 reached end of lifetime.

@weierophinney
Copy link
Member

Um... This component is v2, and still maintained...

On Aug 26, 2016 11:54 AM, "Lennart Sauter" [email protected] wrote:

I created a fork which solves this issue hard-coded here:
https://github.com/Cruiser13/zend-mail
I don't think they'll add a config solution inside the core since ZF1
reached end of lifetime.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#84 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABlV-Sz3eJCN8XTp2BB0UPt4DBVKD-3ks5qjwzZgaJpZM4IOoHi
.

@Cruiser13
Copy link

Sorry, I meant to post it here, got the versions mixed up: zendframework/zf1#709
So there's hope for ZF2 and this issue :)

@jensstalder
Copy link

Same here. Would be great if we could disable verify_peer for Zend\Mail\Protocol\Pop3 Zend\Mail\Protocol\Smtp Zend\Mail\Protocol\Imap. This issue appears to be open for 2 years?

@michalbundyra
Copy link
Member

This repository has been closed and moved to laminas/laminas-mail; a new issue has been opened at laminas/laminas-mail#63.

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

No branches or pull requests

5 participants