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

https://github.com/apple/swift-nio-http2 #1

Open
grosch opened this issue Jun 26, 2018 · 17 comments
Open

https://github.com/apple/swift-nio-http2 #1

grosch opened this issue Jun 26, 2018 · 17 comments

Comments

@grosch
Copy link

grosch commented Jun 26, 2018

The http2 library seems to be ready to use.

@anthonycastelli
Copy link
Member

Right, it is available, however, Vapor needs to app support for it before this library can take advantage of it. Tanner did mention that once Fluent is released, he was going to looking into this.

@MihaelIsaev
Copy link

Any news?

@anthonycastelli
Copy link
Member

Nothing yet. The moment it does get support for HTTP/2 I'll be able to implement this.

@kylebrowning
Copy link

@kylebrowning
Copy link

Sounds like we may not need Vapor to be http2

@kylebrowning
Copy link

FWIW, I've got this working with Swift NIO HTTP2 directly as suggested.

@tanner0101
Copy link

@kylebrowning is that work open source? If so, you should consider submitting it to the Swift Server Work Group. :) https://forums.swift.org/c/server/pitches

@kylebrowning
Copy link

@tanner0101 I don't mind open sourcing it, im just working on the JSON Web Token stuff and trying to use as little dependencies as possible, if any at all.

@kylebrowning
Copy link

kylebrowning commented Jan 9, 2019

@tanner0101 alas ive come full circle to this, vapor/open-crypto#73

Ill try to get it working myself without deps, but its been a whirlwind.

@tanner0101
Copy link

tanner0101 commented Jan 10, 2019

@kylebrowning I agree, it would be great if the APNS package did not need to depend on vapor/crypto. It looks like @anthonycastelli used OpenSSL's ECDSA implementation in the current version of this APNS package. If you are OK with adding OpenSSL as a dependency, you could consider a similar approach to what vapor/crypto does with its CCryptoOpenSSL module. (See Package.swift and Sources/CCryptoOpenSSL).

You could also just import CNIOOpenSSL, but that is not recommended since it's technically a private module and NIO may be moving to BoringSSL in the future. It's a better idea to create your own C...OpenSSL module so you have control. Hopefully a good, unified solution to Crypto will be proposed soon. But, until then, wrapping OpenSSL privately is probably the best option.

@kylebrowning
Copy link

https://github.com/ethanhuang13/CupertinoJWT

@tanner0101 this does it without any deps. May integrate the same way.

@vzsg
Copy link
Member

vzsg commented Jan 10, 2019

this does it without any deps

Wrong. It depends on the CommonCrypto framework, which is not available on Linux.

@kylebrowning
Copy link

Doh. Thanks.

@kylebrowning
Copy link

kylebrowning commented Jan 10, 2019

@vzsg does using SecKeyCreateWithData and SecKeyCreateSignature work with linux?

@tanner0101
Copy link

@kylebrowning I think that's part of the Security module (Sec... prefix) which is not available on Linux.

@kylebrowning
Copy link

kylebrowning commented Jan 11, 2019

Okay so last night I got this working over here, https://github.com/moritzsternemann/nio-apns/tree/kyle-develop

It only depends on OpenSSL. The other NIOH2 package it is importing is simply an HTTP2 client.

Relevant code is here and here

So the question remains now. Do we want to require an HTTP2 NIO client like the one Ive just required and submitted a pr to?

Tanner suggested we work on the pitch to server working group for a standardized HTTP1/2 client but with my open source experience I know that will take some time.

I slightly like the architecture/structure of the other apns library so Im inclined to go work over there especially since it is not dependent on vapor.

Im more inclined to build a Push Notification vapor library that allows Android or iOS devices to pub sub and stores all that inside of vapor. Then vapor just calls the NIO HTTP2 to push notifications.

Im going to start that route and just leave the shared code here for others if they want to go different ways

Once the standard HTTP1/2 client is finished, then we can port to that and drop the support for the custom HTTP2 client.

@kylebrowning
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants