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

ssl不支持有bool类型的参数 #122

Closed
aseTo2016 opened this issue Sep 3, 2020 · 3 comments
Closed

ssl不支持有bool类型的参数 #122

aseTo2016 opened this issue Sep 3, 2020 · 3 comments
Assignees
Labels

Comments

@aseTo2016
Copy link

Describe the bug
A clear and concise description of what the bug is.

Version of go archaius
v1.3.2
To Reproduce
Steps to reproduce the behavior:
ssl:
rest.Provider.verifyPeer: false
rest.Provider.cipherPlugin: go-lib-aes
rest.Provider.cipherSuits: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
rest.Provider.protocol: TLSv1.2
rest.Provider.caFile: xxx
rest.Provider.certFile: xxx
rest.Provider.keyFile: xxx
rest.Provider.certPwdFile: xxx

存在bool类型的,就会出现读取不到这些配置情况,导致证书加载部分异常

代码异常部分
unmarshal.go里面的populateMap函数

		// maybe next map type,此时mapValueType 为string,而 setVal.Type() 为bool,导致函数退出,没有获取完需要的值
		if mapValueType != setVal.Type() {
			return rValue, nil

		}

Logs

@yankooo
Copy link
Collaborator

yankooo commented Sep 4, 2020

map就是map[string]string 类型,go-archaius库不负责对这个map进行转换,类型转换在go-chassis中,能否附加上详细日志信息。(以及go-chassis版本号)

@tianxiaoliang
Copy link
Member

结构体内如果要解析map时,如果value实际存储类型类型和map内指定的value类型不同,那么就无法触发值转换了。

要思考下解决方案

five111 added a commit to five111/go-archaius that referenced this issue Jul 17, 2021
修复读取ssl配置时 因配置bool值导致配置读取不全的bug
go-chassis#122
go-chassis/go-chassis#991
tianxiaoliang pushed a commit that referenced this issue Jul 21, 2021
…t be converted, resulting in configuration loss (#146)

* fixed bug 

修复读取ssl配置时 因配置bool值导致配置读取不全的bug
#122
go-chassis/go-chassis#991

* Add UT for type needs to be converted

为yaml配置需要转换的类型增加UT 例如 bool -> string
@tianxiaoliang
Copy link
Member

请更新到v1.5.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants