File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -414,9 +414,10 @@ public function _s( $args, $assoc_args ) {
414414 // See https://github.com/wp-cli/scaffold-command/issues/181
415415 if ( is_wp_error ( $ response )
416416 && false !== strpos ( $ response ->get_error_message (), 'gnutls_handshake() failed ' ) ) {
417- // Try again with HTTP instead of HTTPS.
418- $ url = str_replace ( 'https:// ' , 'http:// ' , $ url );
419- $ response = wp_remote_post ( $ url , $ post_args );
417+ // Certificate problem, falling back to unsecured request instead.
418+ $ alt_url = str_replace ( 'https:// ' , 'http:// ' , $ url );
419+ WP_CLI ::warning ( "Secured request to {$ url } failed, using {$ alt_url } as a fallback. " );
420+ $ response = wp_remote_post ( $ alt_url , $ post_args );
420421 }
421422
422423 if ( is_wp_error ( $ response ) ) {
You can’t perform that action at this time.
0 commit comments