Skip to content

Honor bccsp.sw.filekeystore.keystore in server config - #517

Open
wieghx wants to merge 2 commits into
hyperledger:mainfrom
wieghx:fix/bccsp-sw-keystore-path
Open

wieghx wants to merge 2 commits into
hyperledger:mainfrom
wieghx:fix/bccsp-sw-keystore-path

Conversation

@wieghx

@wieghx wieghx commented Aug 18, 2026

Copy link
Copy Markdown

Type of change

  • Bug fix

Description

fabric-ca-server-config.yaml documents:

bccsp:
  sw:
    filekeystore:
      keystore: msp/keystore

Viper/mapstructure binds keystore to the field name KeyStorePath, so the value was dropped and ConfigureBCCSP always defaulted to msp/keystore.

After unmarshal, copy bccsp.sw.filekeystore.keystore onto FileKeystoreOpts.KeyStorePath when that field is still empty. This is local to fabric-ca and does not change global decoder tags or fabric-lib-go.

Additional details

go test ./lib/ -count=1 -run TestUnmarshalConfig
go test ./util/ -count=1 -run 'TestConfigureBCCSPKeepsCustomKeyStorePath|TestInitBCCSP'

Related issues

#515

This PR was written in part with the assistance of generative AI.

Viper/mapstructure matches FileKeystoreOpts.KeyStorePath, so the
documented YAML key "keystore" was ignored and ConfigureBCCSP always
fell back to msp/keystore.

Signed-off-by: wieghx <gudemail1991@gmail.com>
@wieghx
wieghx requested a review from a team as a code owner August 18, 2026 06:00
The previous FVT failure was an OpenLDAP cached-connection EOF during
admin reenroll, not a keystore path regression.

Signed-off-by: wieghx <gudemail1991@gmail.com>
@wieghx

wieghx commented Aug 18, 2026

Copy link
Copy Markdown
Author

FVT intermediateca_test.sh failed on postgres admin reenroll with 401 Failed to get user.

That request hit a cached LDAP connection that returned unable to read LDAP response packet: EOF. The pathlen-0 policy check, enroll, and the later mysql pass all succeeded; BCCSP keystore paths stayed at $HOME/msp/keystore.

Pushed an empty commit to retrigger CI.

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.

1 participant