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

Self sign certificate, 400 error #66

Closed
jbarros35 opened this issue Aug 22, 2019 · 6 comments
Closed

Self sign certificate, 400 error #66

jbarros35 opened this issue Aug 22, 2019 · 6 comments

Comments

@jbarros35
Copy link

Hi, I tried on development a self signed certificate, but we could not connect.
Using a default no secure it works but it cannot run on a real device.
Do you have any advice?

    self.socketClient = StompClientLib()
    let url = NSURL(string: "wss://192.168.1.134:9002/api/ws")!
    socketClient.openSocketWithURLRequest(request: NSURLRequest(url: url as URL) , delegate: self)
    // auto reconnect
    socketClient.reconnect(request: NSURLRequest(url: url as URL) , delegate: self, time: 15.0)

Error:
didFailWithError: Optional(Error Domain=SRWebSocketErrorDomain Code=2132 "received bad response code from server 400" UserInfo={NSLocalizedDescription=received bad response code from server 400, HTTPResponseStatusCode=400})
2019-08-22 10:14:30.791461+0100 loxy4-app[8836:6292750] [Debug] [main] [WebSocketConnection.swift:60] serverDidSendError(client:withErrorMessage:detailedErrorMessage:) > received bad response code from server 400
didFailWithError: Optional(Error Domain=SRWebSocketErrorDomain Code=2132 "received bad response code from server 400" UserInfo={NSLocalizedDescription=received bad response code from server 400, HTTPResponseStatusCode=400})

Device:
iPhone 6s IOS 12.4
StompClientLib version:
Using StompClientLib (1.3.2)

@jbarros35
Copy link
Author

I added socketClient.certificateCheckEnabled = false but nothing happens.
we are using NGINX on the server.

@WrathChaos
Copy link
Owner

Hello @jbarros35,
I have never tried it with a selfed signed certificate one. Can you provide me with a simple example to let me work on it?

@jbarros35
Copy link
Author

I created a certificate signed locally on my Mac, and after, I loaded it and ran on websocketd. It cannot be read by API.

@siddharthsuneel
Copy link

@jbarros35 how can we load the self signed certificate while using this stompClientLib ?

Please let me know this so that I can also try this to workout some solution for Issue #67

@jbarros35
Copy link
Author

Done, we moved the server for a backend with a valid certificate.

@stale
Copy link

stale bot commented Nov 28, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants