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

Add jdk default trust manager to KeyVaultTrustManager #23758

Closed
wants to merge 3 commits into from

Conversation

michaelqi793
Copy link
Contributor

@michaelqi793 michaelqi793 commented Aug 25, 2021

Currently, If we override the JCA trust manager globally by KeyVaultTrustManager, when KeyVaultTrustManager is instantiated, if the passed-in key store is null, then KeyVaultTrustManager will create a KeyVaultKeyStore then use it to initialize JDK default trust manager which then calls the KeyVaultKeyStore's getAliases() method which then needs a TSL connection that also creates new KeyVaultTrustManager... So there is a dead loop. To halt this dead loop:
1 Remove the logic of initializing the JDK default trust manager with KeyVaultKeyStore in KeyVaultTrustManager's constructor
2 Add a global static jdk trust manager initialized with jdk key store
3 Add the logic of using global static trust manager to check server/client side at the first place to block the dead loop.

@michaelqi793 michaelqi793 self-assigned this Aug 25, 2021
@ghost ghost added KeyVault azure-spring All azure-spring related issues labels Aug 25, 2021
@michaelqi793 michaelqi793 linked an issue Aug 25, 2021 that may be closed by this pull request
@chenrujun
Copy link
Member

/azp run java - keyvault - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@chenrujun
Copy link
Member

Hi, @michaelqi793 , if this PR is ready to ready for review, please click Ready for review button.


/**
* Stores the keystore.
* Stores the default trust manager with key vault key store.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just keep delete kvTrustManager and otherTrustManager, and make defaultTrustManager use the jreKeyStore?

@michaelqi793
Copy link
Contributor Author

Replaced with #23923

azure-sdk pushed a commit to azure-sdk/azure-sdk-for-java that referenced this pull request Aug 15, 2023
[Hub Generated] Review request for Microsoft.Devices to add version preview/2023-06-30-preview (Azure#23758)

* Adds base for updating Microsoft.Devices from version preview/2022-11-15-preview to version 2023-06-30-preview

* Updates readme

* Updates API version in new specs and examples

* rename cosmosdb collection to container
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
azure-spring All azure-spring related issues KeyVault
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Static way of using Azure key vault
2 participants