{"action":"created","issue":{"url":"https://api.github.com/repos/socketio/socket.io-client-swift/issues/1008","repository_url":"https://api.github.com/repos/socketio/socket.io-client-swift","labels_url":"https://api.github.com/repos/socketio/socket.io-client-swift/issues/1008/labels{/name}","comments_url":"https://api.github.com/repos/socketio/socket.io-client-swift/issues/1008/comments","events_url":"https://api.github.com/repos/socketio/socket.io-client-swift/issues/1008/events","html_url":"https://github.com/socketio/socket.io-client-swift/issues/1008","id":319857737,"number":1008,"title":"How to add certificate (.cer) and private key file (.key) Or All in one (.der) file","user":{"login":"quoctc","id":900704,"avatar_url":"https://avatars3.githubusercontent.com/u/900704?v=4","gravatar_id":"","url":"https://api.github.com/users/quoctc","html_url":"https://github.com/quoctc","followers_url":"https://api.github.com/users/quoctc/followers","following_url":"https://api.github.com/users/quoctc/following{/other_user}","gists_url":"https://api.github.com/users/quoctc/gists{/gist_id}","starred_url":"https://api.github.com/users/quoctc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quoctc/subscriptions","organizations_url":"https://api.github.com/users/quoctc/orgs","repos_url":"https://api.github.com/users/quoctc/repos","events_url":"https://api.github.com/users/quoctc/events{/privacy}","received_events_url":"https://api.github.com/users/quoctc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-05-03T10:03:11Z","updated_at":"2018-05-04T10:33:27Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nI'm trying to connect to my own socket server that required a private key and certificate:\r\nHere is example working with python code:\r\n'''\r\n        print(\"connecting to %s:%s...\" % (HOST, PORT))\r\n        self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\r\n        self.ssl_socket = ssl.wrap_socket(self.socket, keyfile=\"certs/client.key\", certfile=\"certs/client.cer\",    ca_certs=\"certs/ca.cer\", cert_reqs=ssl.CERT_REQUIRED)\r\n        self.ssl_socket.connect((HOST, PORT))\r\n        print(\"connected, socket = %s\" % self.ssl_socket)\r\n'''\r\n\r\nbut, I do not know how to add there of them to SSLSecure. \r\nI have tried many cases even convert there of them to der file or config like this:\r\n'''\r\nlet manager = SocketManager(\r\n            socketURL: URL(string: socketAddress)!,\r\n            config: [\r\n                .log(true),\r\n                .selfSigned(true),\r\n                //.forceWebsockets(true),\r\n                //.forceNew(true),\r\n                .forcePolling(true),\r\n                //.secure(true),\r\n                .sessionDelegate(self)\r\n                //.security(security)\r\n            ]\r\n        )\r\n        let socket = manager.defaultSocket\r\n'''\r\nbut it's still does not work.\r\n\r\nCould you help me please?\r\n\r\nMany thanks!\r\n"},"comment":{"url":"https://api.github.com/repos/socketio/socket.io-client-swift/issues/comments/386562816","html_url":"https://github.com/socketio/socket.io-client-swift/issues/1008#issuecomment-386562816","issue_url":"https://api.github.com/repos/socketio/socket.io-client-swift/issues/1008","id":386562816,"user":{"login":"quoctc","id":900704,"avatar_url":"https://avatars3.githubusercontent.com/u/900704?v=4","gravatar_id":"","url":"https://api.github.com/users/quoctc","html_url":"https://github.com/quoctc","followers_url":"https://api.github.com/users/quoctc/followers","following_url":"https://api.github.com/users/quoctc/following{/other_user}","gists_url":"https://api.github.com/users/quoctc/gists{/gist_id}","starred_url":"https://api.github.com/users/quoctc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quoctc/subscriptions","organizations_url":"https://api.github.com/users/quoctc/orgs","repos_url":"https://api.github.com/users/quoctc/repos","events_url":"https://api.github.com/users/quoctc/events{/privacy}","received_events_url":"https://api.github.com/users/quoctc/received_events","type":"User","site_admin":false},"created_at":"2018-05-04T10:33:27Z","updated_at":"2018-05-04T10:33:27Z","author_association":"NONE","body":"This is error:\r\n2018-05-04 17:31:22.238976+0700 gafs[52531:8504334] LOG SocketIOClient{/}: Adding handler for event: connect\r\n2018-05-04 17:31:22.239242+0700 gafs[52531:8504334] LOG SocketIOClient{/}: Adding handler for event: error\r\n2018-05-04 17:31:22.239444+0700 gafs[52531:8504334] LOG SocketIOClient{/}: Handling event: statusChange with data: [connecting]\r\n2018-05-04 17:31:22.239584+0700 gafs[52531:8504334] LOG SocketIOClient{/}: Joining namespace /\r\n2018-05-04 17:31:22.239706+0700 gafs[52531:8504334] LOG SocketManager: Tried connecting socket when engine isn't open. Connecting\r\n2018-05-04 17:31:22.239810+0700 gafs[52531:8504334] LOG SocketManager: Adding engine\r\n2018-05-04 17:31:22.240279+0700 gafs[52531:8504379] LOG SocketEngine: Starting engine. Server: https://192.168.4.1:8800\r\n2018-05-04 17:31:22.240377+0700 gafs[52531:8504379] LOG SocketEngine: Handshaking\r\n2018-05-04 17:31:22.240678+0700 gafs[52531:8504379] LOG SocketEnginePolling: Doing polling GET https://192.168.4.1:8800/socket.io/?transport=polling&b64=1\r\nOptional(<SecIdentityRef: 0x60000042ff80>)  :::: Optional(<SecIdentityRef: 0x60000042ff80>)\r\nOptional(<SecTrustRef: 0x600000107a10>)  :::: <SecTrustRef: 0x600000107a10>\r\n2018-05-04 17:32:23.950605+0700 gafs[52531:8504399] Task <71084CCE-4F7A-49C8-BA99-5D256EA22160>.<1> finished with error - code: -1001\r\n2018-05-04 17:32:23.962226+0700 gafs[52531:8504388] ERROR SocketEnginePolling: The request timed out.\r\n2018-05-04 17:32:23.962539+0700 gafs[52531:8504388] ERROR SocketEngine: The request timed out."}}
{"actor":{"display_login":"quoctc"}}