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

GetCmsSigner() opens multiple data readers #508

Closed
swoga opened this issue Sep 23, 2019 · 1 comment
Closed

GetCmsSigner() opens multiple data readers #508

swoga opened this issue Sep 23, 2019 · 1 comment

Comments

@swoga
Copy link
Contributor

swoga commented Sep 23, 2019

Hello,

the fix for issue #500 causes a problem with certain certificates databases.

GetCmsSigner() attempts to open a second data reader inside BuildCertificateChain(), while one is already active by dbase.Find(), this is not supported by many databases.

The easiest fix would be to instantiate the CmsSigner outside the loop.

A workaround for MsSQL certificate databases is to enable MultipleActiveResultSets, but no equvalient is available for MySQL.

jstedfast added a commit that referenced this issue Sep 23, 2019
… private key query

Fixes issue #508

As pointed out in issue #508, many SQL databases do not allow reentrant queries.

The simple fix here is to grab the data we need (certificate and prvate key)
and then break out of the query and then build the CmsSigner's certificate chain.
@jstedfast
Copy link
Owner

Thanks for pointing this out! I've just committed a fix!

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 a pull request may close this issue.

2 participants