Skip to content

Use OpenSSL::Digest instead of digest gem#43

Closed
hsbt wants to merge 3 commits intomasterfrom
use-openssl-digest
Closed

Use OpenSSL::Digest instead of digest gem#43
hsbt wants to merge 3 commits intomasterfrom
use-openssl-digest

Conversation

@hsbt
Copy link
Member

@hsbt hsbt commented Sep 27, 2022

digest has been removed at #38.

On another note, openssl provide digest methods same as digest. We should use OpenSSL::Digest for reducing dependencies.

@tmtm
Copy link
Collaborator

tmtm commented Sep 28, 2022

I would prefer Digest to be optional rather than requiring OpenSSL.

@hsbt
Copy link
Member Author

hsbt commented Sep 28, 2022

After releasing net-smtp gem, the users already have openssl because they access rubygems.org via https. There is no strong reason avoid openssl dependency.

Can you describe your motivation?

@tmtm
Copy link
Collaborator

tmtm commented Sep 28, 2022

rubygems.org is a very large gem distribution site, but I think there are ways to install gems other than downloading them directly from rubygems.org.
For example, copy the gem file downloaded from rubygems.org and install it in a Ruby environment that does not support OpenSSL.
Ruby works without OpenSSL, so it is better to be able to use net/smtp even in environments where TLS communication is not required for SMTP.

@rhenium
Copy link
Member

rhenium commented Sep 28, 2022

Note that openssl still depends on digest. OpenSSL::Digest is an implementation of Digest::Class.

Generally speaking, OpenSSL::Digest is useful if the performance is important or an algorithm not supported by digest is required. IMO the current use of Digest::MD5 here is fine.

@hsbt
Copy link
Member Author

hsbt commented Sep 28, 2022

Ruby works without OpenSSL

I'm against this use-case. We should avoid to use network access without openssl today.

But I have no strong opinion this change. I'll close this.

@hsbt hsbt closed this Sep 28, 2022
@hsbt hsbt deleted the use-openssl-digest branch September 28, 2022 07:53
@hsbt
Copy link
Member Author

hsbt commented Sep 28, 2022

@rhenium Thanks for explanation. I misunderstood the internal of OpenSSL::Digest independant from digest.

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.

3 participants