Skip to content

Commit

Permalink
Merge pull request #8 from scuml/SSL
Browse files Browse the repository at this point in the history
Add skip SSL Verification flag
  • Loading branch information
scuml authored Mar 29, 2021
2 parents 862dac0 + df578f6 commit 90d8357
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
Package.resolved
Packages
build/*
.swiftpm*
5 changes: 3 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@ let package = Package(
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(url: "https://github.com/Kitura/BlueSocket.git", from: "1.0.200")
.package(url: "https://github.com/Kitura/BlueSocket.git", from: "1.0.200"),
.package(url: "https://github.com/Kitura/BlueSSLService.git", from: "1.0.200")
],
targets: [
// Targets are the basic building blocks of a package. A target defines a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "SwiftRedis",
dependencies: ["Socket"]),
dependencies: ["Socket", "SSLService"]),
.testTarget(
name: "SwiftRedisTests",
dependencies: ["SwiftRedis"]),
Expand Down
3 changes: 2 additions & 1 deletion Sources/SwiftRedis/RedisSSL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ extension Redis {

extension RedisResp {

convenience init(host: String, port: Int32, sslConfig: SSLService.Configuration? = nil) {
convenience init(host: String, port: Int32, sslConfig: SSLService.Configuration? = nil, sslSkipVerification: Bool: false) {
self.init()
socket = try? Socket.create()
if let sslConfig = sslConfig{
Expand All @@ -49,6 +49,7 @@ extension RedisResp {
// )
do{
let sslService = try SSLService(usingConfiguration: sslConfig)
sslService?.skipVerification = sslSkipVerification
}catch{
print(error)
}
Expand Down

0 comments on commit 90d8357

Please sign in to comment.