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

Getting certificate handle in verification callback #56

Closed
wafflespeanut opened this issue Nov 18, 2018 · 5 comments
Closed

Getting certificate handle in verification callback #56

wafflespeanut opened this issue Nov 18, 2018 · 5 comments
Labels
enhancement New feature or request

Comments

@wafflespeanut
Copy link

wafflespeanut commented Nov 18, 2018

Hi! This is a follow-up to #25 where @Lukasa said:

I'm reluctant to go too far down the road of exposing certificate data here because it starts pushing swift-nio-ssl into the territory of a general-purpose crypto library

I agree that NIO-SSL shouldn't become a crypto lib, but right now we can't get any kind of useful information out of the certificate (other than SPKI). Would it be sensible to expose the underlying opaque pointer for users, so that they can call the necessary OpenSSL APIs and perform their own checks (and possibly warn the users about its unsafety)?

A typical use case would be verifying the signature of a self-signed client certificate, where I'm only concerned about whether the client is the actual owner of the presented public key and nothing else (other use cases include getting CNs, SANs or PEM data).

@Lukasa
Copy link
Contributor

Lukasa commented Nov 18, 2018

Rather than expose the underlying pointer, I’d rather expose the DER-encoded bytes. This is more in line with what we do with the public keys, and avoids users needing to work with unsafe pointers. Does that suit you?

@wafflespeanut
Copy link
Author

Yep! That works for me!

@weissi weissi added the enhancement New feature or request label Mar 26, 2019
@vlm
Copy link

vlm commented Jan 10, 2020

rdar://58481718 (swift-nio-ssl: Expose certificate information to validation callbacks)

@Lukasa
Copy link
Contributor

Lukasa commented Jan 14, 2020

See: #172.

@Lukasa
Copy link
Contributor

Lukasa commented Jan 16, 2020

Resolved by #172, we should hopefully ship a release soon that contains this functionality.

@Lukasa Lukasa closed this as completed Jan 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants