HTTP works in Dart only but not in Flutter

Is there an existing issue for this?

[X] I have searched the existing issues
[X] I have read the guide to filing a bug

Steps to reproduce

Go to https://docs.flutter.dev/cookbook/networking/fetch-data
run the Complete Example at the bottom of the webpage

Expected results
That http I/O would happen.
I have several versions of http or Dio that work fine as Dart classes. As soon as I call them from Flutter, the I/O never happens and it times out.  I thought using Flutter's own code would show me what I am doing wrong, but it also fails.
Actual results
HTTP I/O times out....  see attached

Code sample
Code sample
import 'dart:async';
import 'dart:convert';

import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;

Future<Album> fetchAlbum() async {
  final response = await http
      .get(Uri.parse('https://jsonplaceholder.typicode.com/albums/1'));

  if (response.statusCode == 200) {
    // If the server did return a 200 OK response,
    // then parse the JSON.
    return Album.fromJson(jsonDecode(response.body) as Map<String, dynamic>);
  } else {
    // If the server did not return a 200 OK response,
    // then throw an exception.
    throw Exception('Failed to load album');
  }
}

class Album {
  final int userId;
  final int id;
  final String title;

  const Album({
    required this.userId,
    required this.id,
    required this.title,
  });

  factory Album.fromJson(Map<String, dynamic> json) {
    return switch (json) {
      {
        'userId': int userId,
        'id': int id,
        'title': String title,
      } =>
        Album(
          userId: userId,
          id: id,
          title: title,
        ),
      _ => throw const FormatException('Failed to load album.'),
    };
  }
}

void main() => runApp(const MyApp());

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  late Future<Album> futureAlbum;

  @override
  void initState() {
    super.initState();
    futureAlbum = fetchAlbum();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Fetch Data Example',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
      ),
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Fetch Data Example'),
        ),
        body: Center(
          child: FutureBuilder<Album>(
            future: futureAlbum,
            builder: (context, snapshot) {
              if (snapshot.hasData) {
                return Text(snapshot.data!.title);
              } else if (snapshot.hasError) {
                return Text('${snapshot.error}');
              }

              // By default, show a loading spinner.
              return const CircularProgressIndicator();
            },
          ),
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration
[Upload  here]

Logs
see attached file
logfile.txt
Flutter Doctor output
Doctor output
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS D:\Dropbox\GrampysGames\flutter-client\grampys_games_client> flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.16.0, on Microsoft Windows [Version 10.0.22621.2715], locale en-US)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[X] Visual Studio - develop Windows apps
    X Visual Studio not installed; this is necessary to develop Windows apps.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2022.3)
[√] VS Code (version 1.84.2)
[√] Connected device (4 available)
[√] Network resources

! Doctor found issues in 1 category.
PS D:\Dropbox\GrampysGames\flutter-client\grampys_games_client>

May be missing <uses-permission android:name="android.permission.INTERNET"/> or something similar in AndroidManifest?

Hi @WeekiCode, as pointed out above, can you check if you have added the internet permission to your manifest?
Also, is this issue only on android or do you experience it on other targets, like web or windows? Is the emulator itself able to access the internet?

Yes the manifest allows access.  In my own code, the dart only class works fine, but not when used with Flutter.  I will try other targets and let you know later today.  Not sure how to check if the emulator is able to access the network.  I use the emulator when I run the Dart only version, so I assume it has access.
Fred
Sent from my iPad
On Nov 28, 2023, at 2:26 AM, Daniel Agbemava @.***> wrote:

Hi @WeekiCodehttps://github.com/WeekiCode, as pointed out above, can you check if you have added the internet permission to your manifest?
Also, is this issue only on android or do you experience it on other targets, like web or windows? Is the emulator itself able to access the internet?
—
Reply to this email directly, view it on GitHubhttps://github.com/flutter/flutter/issues/139089#issuecomment-1829251003, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIGJOKGNHOMYPLKJ3RE7UHTYGWG27AVCNFSM6AAAAAA74SW2HGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRZGI2TCMBQGM.
You are receiving this because you were mentioned.Message ID: @.***>

Hi,
I just ran it using Chrome Web Interface. It ran with no bugs.
Enjoy,
Fred
Fred Engel
508-259-7634
From: Daniel Agbemava @.>
Sent: Tuesday, November 28, 2023 2:27 AM
To: flutter/flutter @.>
Cc: WeekiCode @.>; Mention @.>
Subject: Re: [flutter/flutter] HTTP works in Dart only but not in Flutter (Issue #139089)
Hi @WeekiCodehttps://github.com/WeekiCode, as pointed out above, can you check if you have added the internet permission to your manifest?
Also, is this issue only on android or do you experience it on other targets, like web or windows? Is the emulator itself able to access the internet?

Reply to this email directly, view it on GitHubhttps://github.com/flutter/flutter/issues/139089#issuecomment-1829251003, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIGJOKGNHOMYPLKJ3RE7UHTYGWG27AVCNFSM6AAAAAA74SW2HGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRZGI2TCMBQGM.
You are receiving this because you were mentioned.Message ID: @.***>

It's in all 3 of the manifests
Enjoy,
Fred
Fred Engel
508-259-7634
From: Callum Moffat @.>
Sent: Monday, November 27, 2023 4:19 PM
To: flutter/flutter @.>
Cc: WeekiCode @.>; Author @.>
Subject: Re: [flutter/flutter] HTTP works in Dart only but not in Flutter (Issue #139089)
May be missing  or something similar in AndroidManifest?

Reply to this email directly, view it on GitHubhttps://github.com/flutter/flutter/issues/139089#issuecomment-1828631506, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIGJOKHCADRHZZE3JFCOZMLYGT7TTAVCNFSM6AAAAAA74SW2HGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRYGYZTCNJQGY.
You are receiving this because you authored the thread.Message ID: @.***>

Just noticed port "59056" in screenshot. Is that expected??

Hi @WeekiCode, can you test on a physical android device to see if you still have this issue on android? It seems like this is working for you on chrome. I tested the sample on android and it works for me.

I don't understand how you are running the "pure dart" version in the emulator. What method/command?

I am using Android Studio and running unit tests of the http class that is all Dart code.  When I call the same class from the Flutter code, the I/O fails.
Enjoy,
Fred
Fred Engel
508-259-7634
From: Callum Moffat @.>
Sent: Wednesday, November 29, 2023 7:30 AM
To: flutter/flutter @.>
Cc: WeekiCode @.>; Mention @.>
Subject: Re: [flutter/flutter] HTTP works in Dart only but not in Flutter (Issue #139089)
I don't understand how you are running the "pure dart" version in the emulator. What method/command?

Reply to this email directly, view it on GitHubhttps://github.com/flutter/flutter/issues/139089#issuecomment-1831805613, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIGJOKFSTLU5LIZYFKMPIY3YG4TFDAVCNFSM6AAAAAA74SW2HGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZRHAYDKNRRGM.
You are receiving this because you were mentioned.Message ID: @.***>

Hi @WeekiCode, can you access other webpages in the emulator?

Not sure what you mean.  Other pages than what?
Do you mean when I run it in the browser, as opposed to the Android Emulator, can I access other web pages?  If y9ou mean from the Android Emulator, I can access no pages.
Fred
From: Daniel Agbemava @.>
Reply-To: flutter/flutter @.>
Date: Thursday, November 30, 2023 at 1:55 AM
To: flutter/flutter @.>
Cc: Fred Engel @.>, Mention @.***>
Subject: Re: [flutter/flutter] HTTP works in Dart only but not in Flutter (Issue #139089)
Hi @WeekiCodehttps://github.com/WeekiCode, can you access other webpages in the emulator?
—
Reply to this email directly, view it on GitHubhttps://github.com/flutter/flutter/issues/139089#issuecomment-1833207333, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIGJOKBISRB2Z345XMARFTLYHAUWBAVCNFSM6AAAAAA74SW2HGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZTGIYDOMZTGM.
You are receiving this because you were mentioned.Message ID: @.***>

Hi @WeekiCode, just to confirm, if you use the browser in the android emulator, are you able to access any pages?


How to make a constant?

How to create a constant if possible?

For 0 or 1 you can pull an input to VCC or GND. For larger binary numbers you can tie the input of a latch to a binary pattern and read the latch when you need the constant. You could use an array of diodes and a multiplexer to create a simple rom that provides different values depending on the mux selector inputs. Or you could use some kind of rom that you load with a pattern that works for you.

How to create a constant if possible?

Right-click on an input port and select Constant. As far as I remember both gate-level and transistor-level circuits support constant input ports.


Add PUT and POST API endpoints for base models

The first 8 endpoints in the API are mostly read-only GET endpoints. Each model will need write endpoints.
This issue is scoped to include the implementation of tests for each new endpoint.

@annehaley, what's the status of this issue?
If the "baseline" endpoints are all implemented, I think this could be closed in favor of more specific issues addressing specific needs in the API. Let me know what you think.

Sure, we already have the basic endpoints for retrieving information (other than Job-related endpoints, captured in #29), so we can close this in favor of more specific issues later.


Update Amazon Music license

Requires Amazon Prime subscription to use.

@scw @rolandwalker This should probably be :gratis as the binary itself is free-to-use, regardless of payment for Amazon Prime following the cask docs and https://github.com/caskroom/homebrew-cask/issues/8169#issuecomment-67259483 (you can even use your iTunes library music with it).

Good point.


Use first specific version of nhsuk-frontend

Start using tagged version 0.1.0.

@tyom I'm getting the same failure as the CI locally

@tyom it works again if I change devtool: "cheap-source-map" in webpack config
cheap-source-map
Hash: d4d7296fb4d11530b9c1
Version: webpack 2.2.1
Time: 1422ms
                                  Asset       Size  Chunks             Chunk Names
   2c533d8e14f0e9ffedf6f67bcc797d19.png  648 bytes          [emitted]
   63106a89fb653ac0e931b0f14ead7398.png    1.19 kB          [emitted]
   02f0ae015bbb35b18e520a43eaef86b5.png    2.12 kB          [emitted]
   e32db382aafdc5be6bed3bb8aebc5651.png    4.11 kB          [emitted]
    main.bundle.d4d7296fb4d11530b9c1.js  940 bytes       0  [emitted]  main
          main.d4d7296fb4d11530b9c1.css    15.9 kB       0  [emitted]  main
main.bundle.d4d7296fb4d11530b9c1.js.map    1.13 kB       0  [emitted]  main
      main.d4d7296fb4d11530b9c1.css.map   95 bytes       0  [emitted]  main
   [0] ./src/client/js/index.js 264 bytes {0} [built]
   [1] ./src/client/styles/index.js 192 bytes {0} [built]
   [2] ./src/client/js/lib/title.js 129 bytes {0} [built]
   [3] ./src/client/styles/base.scss 41 bytes {0} [built]
   [4] multi ./src/client/js ./src/client/styles 40 bytes {0} [built]
   [5] ./~/css-loader?{"sourceMap":true}!./~/resolve-url-loader!./~/sass-loader/lib/loader.js?{"sourceMap":true,"importOnce":{"index":true,"css":true},"includePaths":["/home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules"]}!./src/client/styles/base.scss 80.6 kB [built]
   [6] ./~/css-loader/lib/css-base.js 1.51 kB [built]
   [7] ../nhsuk-frontend/dist/assets/images/logotype-nhs-colour.png 82 bytes [built]
   [8]<EMAIL_ADDRESS>82 bytes [built]
   [9] ../nhsuk-frontend/dist/assets/images/logotype-nhs-colour__reverse.png 82 bytes [built]
  [10]<EMAIL_ADDRESS>82 bytes [built]
  [11] ./~/style-loader/addStyles.js 7.15 kB [built]
Child extract-text-webpack-plugin:
       [0] ./~/css-loader/lib/css-base.js 1.51 kB {0} [built]
       [1] ../nhsuk-frontend/dist/assets/images/logotype-nhs-colour.png 82 bytes {0} [built]
       [2]<EMAIL_ADDRESS>82 bytes {0} [built]
       [3] ../nhsuk-frontend/dist/assets/images/logotype-nhs-colour__reverse.png 82 bytes {0} [built]
       [4]<EMAIL_ADDRESS>82 bytes {0} [built]
       [5] ./~/css-loader?{"sourceMap":true}!./~/resolve-url-loader!./~/sass-loader/lib/loader.js?{"sourceMap":true,"importOnce":{"index":true,"css":true},"includePaths":["/home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules"]}!./src/client/styles/base.scss 80.6 kB {0} [built]

vs
source-map
Hash: d4d7296fb4d11530b9c1
Version: webpack 2.2.1
Time: 1422ms
                                  Asset       Size  Chunks             Chunk Names
   2c533d8e14f0e9ffedf6f67bcc797d19.png  648 bytes          [emitted]
   63106a89fb653ac0e931b0f14ead7398.png    1.19 kB          [emitted]
   02f0ae015bbb35b18e520a43eaef86b5.png    2.12 kB          [emitted]
   e32db382aafdc5be6bed3bb8aebc5651.png    4.11 kB          [emitted]
    main.bundle.d4d7296fb4d11530b9c1.js  940 bytes       0  [emitted]  main
          main.d4d7296fb4d11530b9c1.css    15.9 kB       0  [emitted]  main
main.bundle.d4d7296fb4d11530b9c1.js.map    1.13 kB       0  [emitted]  main
      main.d4d7296fb4d11530b9c1.css.map   95 bytes       0  [emitted]  main
   [0] ./src/client/js/index.js 264 bytes {0} [built]
   [1] ./src/client/styles/index.js 192 bytes {0} [built]
   [2] ./src/client/js/lib/title.js 129 bytes {0} [built]
   [3] ./src/client/styles/base.scss 41 bytes {0} [built]
   [4] multi ./src/client/js ./src/client/styles 40 bytes {0} [built]
   [5] ./~/css-loader?{"sourceMap":true}!./~/resolve-url-loader!./~/sass-loader/lib/loader.js?{"sourceMap":true,"importOnce":{"index":true,"css":true},"includePaths":["/home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules"]}!./src/client/styles/base.scss 80.6 kB [built]
   [6] ./~/css-loader/lib/css-base.js 1.51 kB [built]
   [7] ../nhsuk-frontend/dist/assets/images/logotype-nhs-colour.png 82 bytes [built]
   [8]<EMAIL_ADDRESS>82 bytes [built]
   [9] ../nhsuk-frontend/dist/assets/images/logotype-nhs-colour__reverse.png 82 bytes [built]
  [10]<EMAIL_ADDRESS>82 bytes [built]
  [11] ./~/style-loader/addStyles.js 7.15 kB [built]
Child extract-text-webpack-plugin:
       [0] ./~/css-loader/lib/css-base.js 1.51 kB {0} [built]
       [1] ../nhsuk-frontend/dist/assets/images/logotype-nhs-colour.png 82 bytes {0} [built]
       [2]<EMAIL_ADDRESS>82 bytes {0} [built]
       [3] ../nhsuk-frontend/dist/assets/images/logotype-nhs-colour__reverse.png 82 bytes {0} [built]
       [4]<EMAIL_ADDRESS>82 bytes {0} [built]
       [5] ./~/css-loader?{"sourceMap":true}!./~/resolve-url-loader!./~/sass-loader/lib/loader.js?{"sourceMap":true,"importOnce":{"index":true,"css":true},"includePaths":["/home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules"]}!./src/client/styles/base.scss 80.6 kB {0} [built]
ravi@ ~/code/nhs/register-with-a-gp-beta-web (bump-nhsuk-frontend)*$ ./node_modules/.bin/webpack -p --config src/client/webpack.config.babel.js
/home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules/source-map/lib/source-map-generator.js:277
      throw new Error('Invalid mapping: ' + JSON.stringify({
      ^

Error: Invalid mapping: {"generated":{"line":1,"column":10265},"source":"webpack:///node_modules/nhsuk-frontend/dist/scss/environment/tools/_mixins.scss","original":{"line":22,"column":-2},"name":null}
    at SourceMapGenerator_validateMapping [as _validateMapping] (/home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules/source-map/lib/source-map-generator.js:277:13)
    at SourceMapGenerator_addMapping [as addMapping] (/home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules/source-map/lib/source-map-generator.js:101:12)
    at /home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules/source-map/lib/source-node.js:345:13
    at SourceNode_walk [as walk] (/home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules/source-map/lib/source-node.js:224:9)
    at SourceNode_walk [as walk] (/home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules/source-map/lib/source-node.js:220:13)
    at SourceNode_walk [as walk] (/home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules/source-map/lib/source-node.js:220:13)
    at SourceNode_toStringWithSourceMap [as toStringWithSourceMap] (/home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules/source-map/lib/source-node.js:336:8)
    at ConcatSource.proto.sourceAndMap (/home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules/webpack-sources/lib/SourceAndMapMixin.js:28:32)
    at Compilation.<anonymous> (/home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules/webpack/lib/SourceMapDevToolPlugin.js:57:32)
    at Array.map (native)
    at Compilation.<anonymous> (/home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules/webpack/lib/SourceMapDevToolPlugin.js:43:84)
    at Array.forEach (native)
    at Compilation.<anonymous> (/home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules/webpack/lib/SourceMapDevToolPlugin.js:42:11)
    at Compilation.applyPlugins1 (/home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules/tapable/lib/Tapable.js:75:14)
    at self.applyPluginsAsync.err (/home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules/webpack/lib/Compilation.js:630:11)
    at next (/home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules/tapable/lib/Tapable.js:138:11)
    at Compilation.compilation.plugin (/home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules/webpack/lib/optimize/UglifyJsPlugin.js:140:5)
    at Compilation.applyPluginsAsyncSeries (/home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules/tapable/lib/Tapable.js:142:13)
    at self.applyPluginsAsync.err (/home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules/webpack/lib/Compilation.js:626:10)
    at next (/home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules/tapable/lib/Tapable.js:138:11)
    at ExtractTextPlugin.<anonymous> (/home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules/extract-text-webpack-plugin/index.js:329:4)
    at Compilation.applyPluginsAsyncSeries (/home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules/tapable/lib/Tapable.js:142:13)
    at sealPart2 (/home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules/webpack/lib/Compilation.js:622:9)
    at next (/home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules/tapable/lib/Tapable.js:138:11)
    at ExtractTextPlugin.<anonymous> (/home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules/extract-text-webpack-plugin/index.js:305:5)
    at /home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules/async/dist/async.js:356:16
    at iteratorCallback (/home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules/async/dist/async.js:936:13)
    at /home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules/async/dist/async.js:840:16
    at /home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules/extract-text-webpack-plugin/index.js:289:6
    at /home/ravi/code/nhs/register-with-a-gp-beta-web/node_modules/async/dist/async.js:356:16

@r4vi Hmm.. Looks like an issue with webpack -p again. I'll investigate.

@tyom 'cheap-module-source-map' seems to work and link to the original .scss so shall we just change to that?

'cheap-module-source-map' seems to work and link to the original .scss so shall we just change to that?
Hang on @ravi. I'd like to better understand what went wrong.

@tyom yeah just letting you know it's an option if you can't figure it out/don't want to spend hours on it

@r4vi The other option could be to only add source maps on the server.

I like the idea of having source maps available on production
On 24 Feb 2017 14:59, "Tyom Semonov"<EMAIL_ADDRESS>wrote:

@r4vi https://github.com/r4vi The other option could be to only add
source maps on the server.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/nhsuk/register-with-a-gp-beta-web/pull/3#issuecomment-282311986,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAihfDQXd0JHnWkVNV3OAeSzbRy9vylpks5rfvBPgaJpZM4MLPhN
.

cheap-source-map is less desirable as it produces wrong file names and lines.

I've updated source maps as suggested in blog post about source maps.


MITM possible with authenticated TCP transport noise stream?

I wrote a challenge authorization based SharedSecretAuth, but with secp256k1 public/private keys and trusted signatories... but then I noticed that if SharedSecretAuth or this new one I wrote one is used with plain TCPTransport then context.remotePublicSecurity and context.localPublicSecurity are undefined in the flows. Doesn't this mean that there in fact can be a man in the middle, and shouldn't the Noise public key hashes for example be available in the context to mitigate this?

Sorry for the late reply here. localPublicSecurity and remotePublicSecurity is something I had in the previous version of the transports to protect against MITM.
I think the switch to using noise-secret-stream with an XX handshake does protect against MITM, but I might be wrong here. Looking at the pattern in Noise Explorer](https://noiseexplorer.com/patterns/XX/):

Message D/E, sent by the initiator, benefits from sender and receiver authentication and is resistant to Key Compromise Impersonation. Assuming the corresponding private keys are secure, this authentication cannot be forged. Message contents benefit from message secrecy and strong forward secrecy: if the ephemeral private keys are secure and the responder is not being actively impersonated by an active attacker, message contents cannot be decrypted.

If the use of the Noise handshake does protect against this the best way forward is probably to remove them, but if not the public key hashes should definitely go in there.

So the thing is there can not be any eavesdropper as a MITM listening the connection between the two noise-stream ends. However if the key pairs at both ends are ephemeral as they seem to be, then the case can be this:
A <===========> M <===========> B
  <-- Noise -->   <-- Noise -->

  Challenge
  ---------------------------->

  Response/Challenge
  <----------------------------

  Response
  ---------------------------->

Noise protects against key compromise impersonation i.e. that the public key of the other end is that public key, and there can be neither Eve nor Mallory in between. But in case of ephemeral keys Mallory can create its own keys and relay all messages between Alice and Bob and if the challenge-response protocol does not take this into account then it authenticates Alice and Bob whereas Noise ensures that the streams between Alice and Mallory, and Mallory and Bob are most secure.
I believe it would be sufficient to have local and remote public security be for example hashes of the localPublicKey/remotePublicKey and remotePublicKey/localPublicKey respectively for the challenge-response protocol - then Mallory cannot intervene.

if the challenge-response is integrated inside the noise stream handshake then it is fine but it was a bit difficult to see if this is the case

i.e. it is the case of A contacting B' and authenticating B -  the authentication of B must be bound to the keys of B' to ensure that B' is B too.

Sorry for the delay here. I've finally found the time to add back the support for this to the Noise connections.

Released in 0.12.0 - feel free to reopen this if there's any issues

I'll check. Thanks!


Doesn't work on windows

When you use the CLI on windows the folders and files created are being created in the wrong directories

accepting PRs, I don't have a windows machine