Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ let package = Package(
],
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/daltoniam/Starscream.git", .exact("3.0.4")),
.package(url: "https://github.com/alibaba/HandyJSON.git", .exact("4.1.0")),
.package(url: "https://github.com/daltoniam/Starscream.git", .exact("3.0.5")),
.package(url: "https://github.com/alibaba/HandyJSON.git", .exact("4.2.0")),
],
targets: [
.target(
Expand Down
6 changes: 3 additions & 3 deletions ScClient.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
#

s.name = "ScClient"
s.version = "1.0.7"
s.version = "1.0.8"
s.summary = "A socketcluster client for iOS and OSX."
s.swift_version = '3.2'

Expand Down Expand Up @@ -136,6 +136,6 @@ Pod::Spec.new do |s|
s.requires_arc = true

# s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" }
s.dependency "Starscream", "~> 3.0.4"
s.dependency "HandyJSON", "~> 4.1.0"
s.dependency "Starscream", "~> 3.0.5"
s.dependency "HandyJSON", "~> 4.2.0"
end
18 changes: 18 additions & 0 deletions Sources/ScClient/client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -196,5 +196,23 @@ public class ScClient : Listener, WebSocketDelegate {
public func disableSSLVerification(value : Bool) {
socket.disableSSLCertValidation = value
}

/**
Uses the .cer files in your app's bundle
*/
public func useSSLCertificate() {
socket.security = SSLSecurity()
}

/**
You load either a Data blob of your certificate or you can use a SecKeyRef if you have a public key you want to use.
- Parameters:
- data: Data blob of your certificate.
- usePublicKeys: The usePublicKeys bool is whether to use the certificates for validation or the public keys.
*/
public func loadSSLCertificateFromData(data : Data, usePublicKeys : Bool = false) {
socket.security = SSLSecurity(certs: [SSLCert(data: data)], usePublicKeys: usePublicKeys)
}

}

2 changes: 1 addition & 1 deletion Tests/ScClientTests/MiscellaneousTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class MiscellaneousTest: XCTestCase {

func testShouldSerializeData() {
let emitEvent = Model.getEmitEventObject(eventName: "chat", data: "My Sample Data" as AnyObject, messageId: 2)
let expectedData = "{\"cid\":2,\"event\":\"chat\",\"data\":\"My Sample Data\"}"
let expectedData = "{\"data\":\"My Sample Data\",\"event\":\"chat\",\"cid\":2}"
XCTAssertEqual(expectedData, emitEvent.toJSONString())
}

Expand Down