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 for IIS support. #58

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dependency-minification.php
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ static function minify( $cached ) {

// Dependency is not self-hosted or it the filesystem read failed, so do HTTP request
if ( false === $contents ) {
$r = wp_remote_get( $src );
$r = wp_remote_get( $src, array( 'sslverify' => false ) );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@msigley I think this should be changed to be something like this:

$sslverify = apply_filters( 'depmin_https_ssl_verify', empty( $GLOBALS['is_IIS'] ), $src );
$r = wp_remote_get( $src, compact( 'sslverify' ) );

This then turns off SSL verification for IIS only by default, but also allows it to be filtered.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Merge and revise in a commit. Nice work @westonruter!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@msigley are you going to add another commit to your PR with this change?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commited the changes requested

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@westonruter do the changes meet your approval?

if ( is_wp_error($r) ) {
throw new Exception("Failed to retrieve $src: " . $r->get_error_message());
} elseif ( intval( wp_remote_retrieve_response_code( $r ) ) !== 200 ) {
Expand Down