aliyun / aliyun-openapi-cpp-sdk

Alibaba Cloud SDK for C++
Other
99 stars 77 forks source link

add Client Configuration : rejectUnauthorized #115

Closed AxiosLeo closed 4 years ago

AxiosLeo commented 4 years ago

rejectUnauthorized default value is true

codecov-commenter commented 4 years ago

Codecov Report

Merging #115 into master will decrease coverage by 0.05%. The diff coverage is 81.25%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #115      +/-   ##
==========================================
- Coverage   93.44%   93.38%   -0.06%     
==========================================
  Files          66       66              
  Lines        1801     1815      +14     
==========================================
+ Hits         1683     1695      +12     
- Misses        118      120       +2     
Impacted Files Coverage Δ
...re/include/alibabacloud/core/ClientConfiguration.h 100.00% <ø> (ø)
core/src/ClientConfiguration.cc 91.42% <40.00%> (-8.58%) :arrow_down:
core/src/CoreClient.cc 94.44% <100.00%> (+0.15%) :arrow_up:
core/src/CurlHttpClient.cc 94.06% <100.00%> (+1.02%) :arrow_up:
core/src/HttpClient.cc 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update db4bd7a...80b55b8. Read the comment docs.

JacksonTian commented 4 years ago

使用 SSL 加密应该是个默认行为。rejectUnauthorized = true 默认。

只在必须的场景下才关掉 SSL 校验。

JacksonTian commented 4 years ago

参考: rejectUnauthorized If not false, the server certificate is verified against the list of supplied CAs. An 'error' event is emitted if verification fails; err.code contains the OpenSSL error code. Default: true.

逻辑没问题,API 语义不够好。