Skip to content
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

自动下载证书支持代理 #124

Merged
merged 6 commits into from
Feb 7, 2023
Merged

自动下载证书支持代理 #124

merged 6 commits into from
Feb 7, 2023

Conversation

xy-peng
Copy link
Contributor

@xy-peng xy-peng commented Jan 18, 2023

使用大概是这样的

// 设置下载自动更新证书时网络配置
DefaultHttpClientBuilder clientBuilder = 
    new DefaultHttpClientBuilder()
        .proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("localhost", 8099));

// 设置商户配置,并使用 httpClientBuilder 设置 HttpClient 所需的网络配置
Config config =
    new RSAAutoCertificateConfig.Builder()
        .merchantId(merchantId)
        .privateKeyFromPath(privateKeyPath)
        .merchantSerialNumber(merchantSerialNumber)
        .apiV3Key(apiV3key)
        .httpClientBuilder(clientBuilder)
        .build();

clientBuilder.config(config);
JsapiService service = new JsapiService.Builder()
        .httpclient(clientBuilder.build())
        .build();

说明可参考 wiki 上的配置详解

@xy-peng xy-peng force-pushed the feat_autocertwithproxy branch from 4d8ba10 to f43fd7b Compare February 7, 2023 03:37
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 7, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

86.2% 86.2% Coverage
0.0% 0.0% Duplication

@xy-peng xy-peng merged commit c25c725 into main Feb 7, 2023
@xy-peng xy-peng deleted the feat_autocertwithproxy branch February 7, 2023 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants