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

Problem with HTTPS url #89

Closed
hasanozkaynak26 opened this issue May 13, 2022 · 4 comments
Closed

Problem with HTTPS url #89

hasanozkaynak26 opened this issue May 13, 2022 · 4 comments

Comments

@hasanozkaynak26
Copy link

I'm working well with localhost applications, but when i connect to https url i gave error like this.

Here is log.
I/flutter (13925): Starting HubConnection.
I/flutter (13925): Starting connection with transfer format 'TransferFormat.text'.
I/flutter (13925): Sending negotiation request: https://url:2600/notify/negotiate.
I/flutter (13925): Selecting transport 'HttpTransportType.serverSentEvents'.
I/flutter (13925): (SSE transport) Connecting.
I/flutter (13925): SSE connected to https://url:2600/notify?id=UvR4grgdVXNVH0cd4-Wqzw&access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9zeXN0ZW0iOiIxZDMyZGUwYi02MzQ5LTQzNGYtZmMxZi0wOGRhMTNlZjc0NjUiLCJuYW1laWQiOiIzNmYwYjcyOC01NjA4LTQ3MGItYjQ1ZS0zMWI1YjY4YTA0MTUiLCJuYmYiOjE2NTI0NDgzMjgsImV4cCI6MTY1NTA0MDMyOCwiaWF0IjoxNjUyNDQ4MzI4fQ.1nsEoT33fdsV00Mrukq963YGwGsgM4xUtH6CHS1oPKw
I/flutter (13925): The HttpConnection connected successfully.
I/flutter (13925): Sending handshake request.
I/flutter (13925): (SSE transport) sending data. String data of length '32'.
I/flutter (13925): (SSE transport) request complete. Response status: 200.
I/flutter (13925): Using HubProtocol 'json'.
I/flutter (13925): HttpConnection.stopConnection(Exception: Failed to connect to https://url:2600/notify?id=UvR4grgdVXNVH0cd4-Wqzw) called while in state ConnectionState.connected.
I/flutter (13925): Connection disconnected with error 'Exception: Failed to connect to https://url:2600/notify?id=UvR4grgdVXNVH0cd4-Wqzw'.
I/flutter (13925): HubConnection.connectionClosed(Exception: Failed to connect to https://url:2600/notify?id=UvR4grgdVXNVH0cd4-Wqzw) called while in state HubConnectionState.connecting.
I/flutter (13925): Hub handshake failed with error 'Exception: Failed to connect to https://url:2600/notify?id=UvR4grgdVXNVH0cd4-Wqzw' during start(). Stopping HubConnection.
I/flutter (13925): Call to HttpConnection.stop(Exception: Failed to connect to https://url:2600/notify?id=UvR4grgdVXNVH0cd4-Wqzw) ignored because the connection is already in the disconnected state.
I/flutter (13925): HubConnection failed to start successfully because of error '{Exception: Failed to connect to https://url:2600/notify?id=UvR4grgdVXNVH0cd4-Wqzw.toString()}'.
E/flutter (13925): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Exception: Failed to connect to https://url:2600/notify?id=UvR4grgdVXNVH0cd4-Wqzw
E/flutter (13925):

@MehmetCANKAYA
Copy link

It is a bug. Write acces_token to url as query string.

HubConnectionBuilder()
.withUrl(
'https://xxx.abc.com/xHub?access_token=eyJhbGc.... like that..

the following line is giving an erorr.

accessTokenFactory: () async =>
"eyJhbGc....

@hasanozkaynak26
Copy link
Author

It is a bug. Write acces_token to url as query string.

HubConnectionBuilder() .withUrl( 'https://xxx.abc.com/xHub?access_token=eyJhbGc.... like that..

the following line is giving an erorr.

accessTokenFactory: () async => "eyJhbGc....

Thank you very much. It is working now. Very appreciated.

@hasanozkaynak26
Copy link
Author

#89 (comment)_ helped me

@hasanozkaynak26 hasanozkaynak26 changed the title Problem with HTTPS url Problem with HTTPS url #bug May 23, 2022
@hasanozkaynak26 hasanozkaynak26 changed the title Problem with HTTPS url #bug Problem with HTTPS url May 23, 2022
@Hamza0101-bug
Copy link

@hasanozkaynak26 how do you pass the token? bcz i am getting the same error

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

No branches or pull requests

3 participants