file_get_contents ignoring verify_peer=>false?

前端 未结 5 762
遇见更好的自我
遇见更好的自我 2020-12-16 16:14

file_get_contents with https hosts works just fine, except for a particular host (test api server from some company - ip whitelisted, can\'t give you URL to test). This rule

5条回答
  •  眼角桃花
    2020-12-16 16:50

    dont' know if this will actually help, but do try removing the SSL options from your option array.

    The reason behind this: according to http://www.php.net/manual/en/context.ssl.php , verify_peer is false by default.

    allow_self_signed REQUIRES verify_peer, and is false by default.

    From the above, I gather that allow_self_signed probably overrides your setting for verify_peer.

    So please try without any option for SSL, or without the allow_self_signed, and let us know if that helped any.

提交回复
热议问题