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

fix image loading over https #988

Merged
merged 1 commit into from
Jul 1, 2017

Conversation

troosan
Copy link
Contributor

@troosan troosan commented Jan 29, 2017

this fixes issue #983
As images are now loaded using file_get_contents, it is possible to modify the stream context using stream_context_set_default(...).
In ImageTest I'm using

        $arrContextOptions = array(
            "ssl" => array(
                "verify_peer" => false,
                "verify_peer_name" => false,
            ),
        );
        stream_context_set_default($arrContextOptions);

which you should obviously not do in a production environment, instead you should pass the certificate to use to connect to the remote url:

        $arrContextOptions = array(
            "ssl" => array(
                "cafile" => "/path/to/bundle/cacert.pem",
                "verify_peer" => true,
                "verify_peer_name" => true,
            ),
        );
        stream_context_set_default($arrContextOptions);

set thread on stackoverflow

@troosan troosan added this to the v0.14.0 milestone Jul 1, 2017
@troosan troosan merged commit ccccb3d into PHPOffice:develop Jul 1, 2017
@troosan troosan deleted the fix_image_loading_over_https branch July 10, 2017 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant