Skip to content

Conversation

@dw-kihara
Copy link

I discovered the tests were failing because the tests check the contents of certificates, which changes frequently.
To address this, I introduced cacerts_test_data/0 which returns the fixed certificates for testing.

Although cacerts/0 could return the fixed certificats during tests,
I kept it to return the content of priv/cacerts.pem to ensure it provides the correct certificates.

I also modified certifi_pt.erl to transform both functions and to make Dialyzer happy.

Comment on lines +5 to +6
%% Update this when updating priv/cacerts.pem.
-define(NUM_OF_CERTS, 147).
Copy link
Author

Choose a reason for hiding this comment

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

Initially, I thought this number could be generated by parsing priv/cacerts.pem.
However, I realized this approach would weaken the test because parsing the file to verify it is properly parsed sounds somewhat circular.

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