警告:DOMDocument :: load():对等证书CN,无法启用加密,I / O警告,无法打开流,

时间:2018-03-14 20:11:45

标签: apache openssl php-7

在Wordpress php5中,一切都很好

现在使用PHP7我收到了这些警告:

警告:DOMDocument :: load():对等证书CN = getalongwithgod.com' did not match expected CN= www.readmk.com'在/ home / readmk11 / staging / 1 / wp-content / themes / Shulamite / includes / readmk-feed第21行的.php

警告:DOMDocument :: load():无法在第21行的/home/readmk11/staging/1/wp-content/themes/Shulamite/includes/readmk-feed.php中启用加密

警告:DOMDocument :: load(https://www.readmk.com/devotionals/feed):无法打开流:/home/readmk11/staging/1/wp-content/themes/Shulamite/includes/readmk-feed.php上的操作失败线21

警告:DOMDocument :: load():I / O警告:无法在/ home / readmk11 / staging / 1 / wp-content / themes / Shulamite / includes / readmk中加载外部实体“https://www.readmk.com/devotionals/feed”第21行的-feed.php

我的班级-wp-http-streams.php 这样说:

$context = stream_context_create( array(
        'ssl' => array(
            'verify_peer' => $ssl_verify,
            //'CN_match' => $arrURL['host'], // This is handled by self::verify_ssl_certificate()
            'capture_peer_cert' => $ssl_verify,
            'SNI_enabled' => true,
            'cafile' => $r['sslcertificates'],
            'allow_self_signed' => ! $ssl_verify,
        )
    ) );

另外,我的班级-wp-http-curl.php 这样说:

/ *          * CURLOPT_TIMEOUT和CURLOPT_CONNECTTIMEOUT期望整数。从那以后必须使用ceil。          *值为0将允许无限制超时。          * /         $ timeout =(int)ceil($ r ['timeout']);         curl_setopt($ handle,CURLOPT_CONNECTTIMEOUT,$ timeout);         curl_setopt($ handle,CURLOPT_TIMEOUT,$ timeout);

    curl_setopt( $handle, CURLOPT_URL, $url);
    curl_setopt( $handle, CURLOPT_RETURNTRANSFER, true );
    curl_setopt( $handle, CURLOPT_SSL_VERIFYHOST, ( $ssl_verify === true ) ? 2 : false );
    curl_setopt( $handle, CURLOPT_SSL_VERIFYPEER, $ssl_verify );

    if ( $ssl_verify ) {
        curl_setopt( $handle, CURLOPT_CAINFO, $r['sslcertificates'] );
    }

    curl_setopt( $handle, CURLOPT_USERAGENT, $r['user-agent'] );

我在网站上收到四个错误,我认为这些代码正在影响:

是否有人知道需要更改我的代码以使这些警告消失并且网站在PHP7中再次获取信息?

0 个答案:

没有答案