Back

[Solved] Error AppwriteRealtime: Allow self-signed certificate

  • 0
  • Flutter
  • Realtime
sharpsaravanan
27 Oct, 2023, 17:13

Subscription Error code: client.setSelfSigned(status: true); final realtime = Realtime(client); final subscription = realtime.subscribe(['account']);

error: AppwriteRealtime: Allow self-signed certificate subscription: wss://cloud.appwrite.io/v1/realtime?project=64d69783f20b0ed93006&channels%5B%5D=account

TL;DR
The user was getting an error "AppwriteRealtime: Allow self-signed certificate" when trying to subscribe to a channel using AppwriteRealtime. They were using a self-signed certificate and had set `setSelfSigned(status: true)` in their code. The solution was to remove the line `setSelfSigned(status: true)` as it was not needed.
sharpsaravanan
27 Oct, 2023, 17:13

please help me to solve this issue

D5
27 Oct, 2023, 17:17

You have setselfsigned set to true

D5
27 Oct, 2023, 17:18

That's not needed in cloud

D5
27 Oct, 2023, 17:18

So you should remove that line

sharpsaravanan
27 Oct, 2023, 17:41

Thanks😆 (removed setselfsigned) error (AppwriteRealtime: Allow self-signed certificate) gone but

sharpsaravanan
27 Oct, 2023, 17:41

subscription: wss://cloud.appwrite.io/v1/realtime?project=64d69783f20b0ed93006&channels%5B%5D=account

sharpsaravanan
27 Oct, 2023, 17:42

still persist

D5
27 Oct, 2023, 17:44

wss is not http

D5
27 Oct, 2023, 17:44

replace wss with https

D5
27 Oct, 2023, 17:44

When you set the endpoint

sharpsaravanan
27 Oct, 2023, 17:45

server endpoint--'https://cloud.appwrite.io/v1'

D5
27 Oct, 2023, 17:46

So althought that you get the error?

D5
27 Oct, 2023, 17:46

What's the code?

sharpsaravanan
27 Oct, 2023, 17:50

same as in sample code

sharpsaravanan
27 Oct, 2023, 17:50

final client = Client() .setEndpoint('https://cloud.appwrite.io/v1') .setProject('[PROJECT_ID]');

final realtime = Realtime(client);

final subscription = realtime.subscribe(['account']);

subscription.stream.listen((response) { // Callback will be executed on all account events. print(response); })

sharpsaravanan
27 Oct, 2023, 18:00

as per doc--default the endpoint is wss://cloud.appwrite.io/v1/realtime

Drake
27 Oct, 2023, 18:03

what's the error?

Drake
27 Oct, 2023, 18:04

FYI, it's best to wrap code in backticks to format a bit nicer. You can use 1 backtick for inline code (https://www.markdownguide.org/basic-syntax/#code) and 3 backticks for multiline code (https://www.markdownguide.org/extended-syntax/#syntax-highlighting.

sharpsaravanan
27 Oct, 2023, 18:05

flutter: subscription: wss://cloud.appwrite.io/v1/realtime?project=64d69783f20b0ed93006&channels%5B%5D=account

Drake
27 Oct, 2023, 18:05

that's not an error...

sharpsaravanan
27 Oct, 2023, 18:21

ok

sharpsaravanan
27 Oct, 2023, 18:24

Thanks for the quick response🙂

sharpsaravanan
27 Oct, 2023, 18:31

[Solved] Error AppwriteRealtime: Allow self-signed certificate

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more