-
Notifications
You must be signed in to change notification settings - Fork 189
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
增加HttpProfile中对https请求是否进行严格验证的选项 #82
base: master
Are you sure you want to change the base?
Conversation
/** | ||
* @var string|bool 请求时验证SSL证书行为 | ||
*/ | ||
private $verify; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
构造函数里给一个初始值,默认应该是开启检查
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
即使无初始值,默认是开启检查,不过严谨起见还是加入初始值吧。
文档给出的默认值为GuzzleHttp\RequestOptions::VERIFY
就是这个参数是否需要作为构造函数的输入参数之一?
public function __construct($protocol = null, $endpoint = null, $reqMethod = null, $reqTimeout = null, $verify = RequestOptions::VERIFY)
{
$this->reqMethod = $reqMethod ? $reqMethod : HttpProfile::$REQ_POST;
$this->endpoint = $endpoint;
$this->reqTimeout = $reqTimeout ? $reqTimeout : HttpProfile::$TM_MINUTE;
$this->protocol = $protocol ? $protocol : HttpProfile::$REQ_HTTPS;
$this->verify = $verify;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
一般不会用到,感觉构造函数的参数列表太长了。
那等我验证下,在做决定把 |
我先提交一份最少变更的上来吧,变更参数的这些后续再根据情况考虑 public function __construct($protocol = null, $endpoint = null, $reqMethod = null, $reqTimeout = null)
{
$this->reqMethod = $reqMethod ? $reqMethod : HttpProfile::$REQ_POST;
$this->endpoint = $endpoint;
$this->reqTimeout = $reqTimeout ? $reqTimeout : HttpProfile::$TM_MINUTE;
$this->protocol = $protocol ? $protocol : HttpProfile::$REQ_HTTPS;
$this->verify = RequestOptions::VERIFY;
} |
为什么不合并呢??? @zqfan
希望尽可合并!谢谢。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请尽早合并❤️
或者你们也可以直接提供CA根证书文件啊。 |
暴露出GuzzleHttp库对ssl证书验证行为的选项,方便调试
https://docs.guzzlephp.org/en/stable/request-options.html#verify