Skip to content
Open
Changes from all commits
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
11 changes: 11 additions & 0 deletions src/helper/class-ee-site.php
Original file line number Diff line number Diff line change
Expand Up @@ -1678,6 +1678,17 @@ public function ssl_verify( $args = [], $assoc_args = [], $www_or_non_www = fals
$this->site_data = get_site_info( $args );
}

// A failed LE setup (init_le) clears site_ssl and suggests ssl-verify; point to the command that enables SSL properly.
if ( empty( $this->site_data['site_ssl'] ) ) {
$wildcard_flag = empty( $this->site_data['site_ssl_wildcard'] ) ? '' : ' --wildcard';
EE::error( sprintf( 'SSL is not enabled on %1$s. Enable Let\'s Encrypt SSL with `ee site update %1$s --ssl=le%2$s`.', $this->site_data['site_url'], $wildcard_flag ) );
}

// SSL verification issues a Let's Encrypt cert via ACME, which is meaningless for non-LE certs and would clobber custom/self/inherited ones.
if ( 'le' !== $this->site_data['site_ssl'] ) {
EE::error( 'SSL verification is only applicable to Let\'s Encrypt certificates.' );
}

if ( ! isset( $this->le_mail ) ) {
$this->le_mail = \EE::get_config( 'le-mail' ) ?? \EE::input( 'Enter your mail id: ' );
}
Expand Down
Loading