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

Issue with SSL #151

Open
GamePowerDev opened this issue Jun 29, 2021 · 2 comments
Open

Issue with SSL #151

GamePowerDev opened this issue Jun 29, 2021 · 2 comments

Comments

@GamePowerDev
Copy link

Hello! so I've followed the guide for getting up SSL with jaguar (I'm using flutter with a headless webview). But I'm getting the following error when trying to access the URL:

"An SSL error has occurred and a secure connection to the server cannot be made."

Here's my current code snippet:

Future<void> _startServer() async {
    final cert = await rootBundle
        .load("assets/ssl/certificate.pem");
    final keys =
        await rootBundle.load("assets/ssl/keys.pem");
    final security = new SecurityContext()
      ..setTrustedCertificatesBytes(cert.buffer.asInt8List())
      ..usePrivateKeyBytes(keys.buffer.asInt8List());

    final server = Jaguar(securityContext: security);

    server.addRoute(serveFlutterAssets());

    await server.serve(logRequests: true);

    server.log.onRecord.listen((r) => print(r));
  }
@xiaocode337317439
Copy link

me too

@tejainece
Copy link
Member

@xiaocode337317439 There is an example here: https://github.com/jaguar-examples/https. It works for me. Can you try it?

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