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

Support for OpenSSL 1.1.X #61

Merged
merged 4 commits into from
Oct 26, 2018
Merged

Support for OpenSSL 1.1.X #61

merged 4 commits into from
Oct 26, 2018

Conversation

nethraravindran
Copy link
Contributor

Description

Currently, BlueSSLService doesn't add support for openssl 1.1.X. This PR aims to add support for both openssl versions 1.0.X and 1.1.X

Resolves : Kitura/Kitura#1341

How Has This Been Tested?

Tested on both Ubuntu 16.04 and 18.04 with openssl 1.0.x and 1.1.x

Checklist:

  • I have submitted a CLA form
  • If applicable, I have added tests to cover my changes.

@nethraravindran
Copy link
Contributor Author

@djones6 @ianpartridge @pushkarnk Please review.

Package.swift Outdated
@@ -29,7 +29,7 @@ var targetDependencies: [Target.Dependency] = [.byName(name: "Socket")]

#if os(Linux)

packageDependencies.append(.package(url: "https://github.com/IBM-Swift/OpenSSL.git", from: "2.0.0"))
packageDependencies.append(.package(url: "https://github.com/nethraravindran/OpenSSL.git", .branch("openSSL")))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a temporary change until we a release for OpenSSL https://github.com/IBM-Swift/OpenSSL

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd hesitate to merge this until the change to OpenSSL is merged as well and passing all the necessary CI checks.

@nethraravindran nethraravindran force-pushed the openSSL branch 2 times, most recently from a2ee480 to e85d387 Compare October 18, 2018 15:25
Copy link
Collaborator

@billabt billabt left a comment

Choose a reason for hiding this comment

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

Overall the changes look good. Although, I'd prefer to see the obsolete code deleted rather than commented out. It'd be nice if you could do that prior to the merge. Also, would like to see the new extensions that were added documented properly.

That and get it to pass CI. 👍?

.travis.yml Outdated
@@ -17,6 +17,10 @@ matrix:
- os: linux
dist: trusty
sudo: required
- os: linux
Copy link
Collaborator

@billabt billabt Oct 22, 2018

Choose a reason for hiding this comment

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

This block you added for Swift 4.2 is not needed. The block right before this will default to the contents of .swift-version. BlueSSLService is already building on Swift 4.2.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@billabt Thank you!

@ianpartridge
Copy link
Contributor

@nethraravindran looks like the build is failing on Linux 4.0.3 and Linux 4.1.3

@billabt
Copy link
Collaborator

billabt commented Oct 24, 2018

@nethraravindran: Looks like everything is going to be fine now. However, can you document the extensions you added for Linux before I merge it? Thanks.

@ianpartridge
Copy link
Contributor

Hi @billabt we have a little more work to do on this before it's ready, @nethraravindran will update soon :)

@nethraravindran
Copy link
Contributor Author

I have added support for Swift 4.0 and 4.1 @billabt @ianpartridge Please review.
Thanks in advance :)




#if swift(>=4.2)
Copy link
Contributor

Choose a reason for hiding this comment

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

If I am understanding correctly this means that on Swift 4.2 the cSSL property will be an OpaquePointer? but on earlier versions of Swift it will be UnsafeMutablePointer<SSL>?? So we would have different public API depending on the Swift version? That seems like a problem...

Could it be OpaquePointer? on all Swift versions?

Copy link
Collaborator

@billabt billabt Oct 24, 2018

Choose a reason for hiding this comment

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

@ianpartridge This property as well as the method and context properties are only public so that they can be used by the verifyCallback if the developer desires. The use of this callback implies and expects that the developer have an in depth knowledge of how BlueSSLService is working. NONE of these properties are exposed by any public functions although they're used by a few private functions. The public API, IMHO, remains the same. The risk is very, very low and only for developers who are using the verifyCallback and those folks should be aware since the contents of the callback will in all probability be platform specific.

//
// Hopefully, in time, these extensions can be removed.

extension UnsafePointer {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please document these extensions...

Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's leave it as is... After reading the above, it's pretty obvious what's going on.

Copy link
Collaborator

@billabt billabt left a comment

Choose a reason for hiding this comment

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

Withdraw my previous request for documentation of the funky pointer extensions. The prolog in the file describes them well enough. 😝

//
// Hopefully, in time, these extensions can be removed.

extension UnsafePointer {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's leave it as is... After reading the above, it's pretty obvious what's going on.

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