Closed trembel closed 2 months ago
Thanks for this -- this looks really good!
Thanks for review, I will take care later today.
This is excellent, thanks! I need to think a bit about if/where we store certificates, and so on, but that's a luxury add on: this PR does the hard bit.
If you force push a rustfmt, I'll merge this.
Sure, thanks a lot for the quick process! rustfmt is pushed.
Thanks!
This commit adds support for TLS-encrypted redirect URIs. The commit adds a second server for https:
rcgen
to generate a new TLS certificate (only in memory)rustls
to do the TLS handshake and convert the TCPStream into a TLS streamrequest
function (and its dependent) to accept an object implementingRead + Write
instead of justTCPStream
redirect_uri
that containhttps
to the https serverThis last point I think can be discussed: Should all redirect uri's containing
https
be redirected to thehttps
server or only the redirect uri's containinglocalhost
? IMO it should not make a difference, as all https URIs will support TLS.Also: the self-signed certificate is not trusted per default (at least on Firefox), so one has to go "Advanced" -> "Accept Risk ..." in Firefox when being redirected. For me this is no issue, if it is one, we could save the TLS certificate to the apropriate location(s) (requiring sudo).
I have not tested this commit across a http URI, just because I have no OAuth provider except of Microsoft (for hotmail). This commit solves #40.