mirror of
https://github.com/201206030/novel.git
synced 2025-04-27 07:30:50 +00:00
feat: 设置 Elasticsearch 的 ssl 认证模式
This commit is contained in:
parent
fc7983236b
commit
90f5780796
@ -25,7 +25,6 @@ import java.security.cert.X509Certificate;
|
|||||||
* @author xiongxiaoyang
|
* @author xiongxiaoyang
|
||||||
* @date 2022/5/23
|
* @date 2022/5/23
|
||||||
*/
|
*/
|
||||||
@ConditionalOnProperty(value = "spring.elasticsearch.enabled", havingValue = "true")
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class EsConfig {
|
public class EsConfig {
|
||||||
@ -42,6 +41,7 @@ public class EsConfig {
|
|||||||
* fix `sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException:
|
* fix `sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException:
|
||||||
* unable to find valid certification path to requested target`
|
* unable to find valid certification path to requested target`
|
||||||
*/
|
*/
|
||||||
|
@ConditionalOnProperty(value = "spring.elasticsearch.ssl.verification-mode", havingValue = "none")
|
||||||
@Bean
|
@Bean
|
||||||
RestClient elasticsearchRestClient(RestClientBuilder restClientBuilder,
|
RestClient elasticsearchRestClient(RestClientBuilder restClientBuilder,
|
||||||
ObjectProvider<RestClientBuilderCustomizer> builderCustomizers) {
|
ObjectProvider<RestClientBuilderCustomizer> builderCustomizers) {
|
||||||
|
@ -60,6 +60,11 @@
|
|||||||
"name": "xxl.job.accessToken",
|
"name": "xxl.job.accessToken",
|
||||||
"type": "java.lang.String",
|
"type": "java.lang.String",
|
||||||
"description": "xxl-job accessToken."
|
"description": "xxl-job accessToken."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "spring.elasticsearch.ssl.verification-mode",
|
||||||
|
"type": "java.lang.String",
|
||||||
|
"description": "设置 ssl 的认证模式,如果该配置项为 none ,说明不需要认证,信任所有的 ssl 证书."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -97,6 +97,9 @@ spring:
|
|||||||
- https://my-deployment-ce7ca3.es.us-central1.gcp.cloud.es.io:9243
|
- https://my-deployment-ce7ca3.es.us-central1.gcp.cloud.es.io:9243
|
||||||
username: elastic
|
username: elastic
|
||||||
password: qTjgYVKSuExX6tWAsDuvuvwl
|
password: qTjgYVKSuExX6tWAsDuvuvwl
|
||||||
|
# 设置 ssl 的认证模式,如果该配置项为 none ,说明不需要认证,信任所有的 ssl 证书。
|
||||||
|
# ssl:
|
||||||
|
# verification-mode: none
|
||||||
|
|
||||||
# Spring AMQP 配置
|
# Spring AMQP 配置
|
||||||
amqp:
|
amqp:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user