JSch: How to configure diffie-hellman-group14-sha256? - sftp

I am trying to connect to a ssh server with diffie-hellman-group14-sha256#ssh.com, diffie-hellman-group-exchange-sha256 algorithm.
But my JSch client always encrypts with diffie-hellman-group14-sha1.
What can I do to setup the sha256 algorithm?
The problem occurs on our test environment only. The settings there are same as prod environments. Just OpenSSH version differs - it is newer on test.
Java version: 1.8.0_151
Server logs: "The JCE Unlimited Strength Jurisdiction Policy File was found"
Available in server lib: jce_policy-8/US_export_policy.jar, jce_policy-8/local_policy.jar
My code looks like:
JSch jsch = new JSch();
Session session = null;
Channel channel = null;
ChannelSftp c = null;
//Now connect and SFTP to the SFTP Server
try {
//Create a session sending through our username and password
session = jsch.getSession(ftpUserName, ftpHost, ftpPort);
session.setPassword(ftpPassword);
Properties config = new Properties();
config.put("StrictHostKeyChecking", "no");
session.setConfig(config);
session.connect();
//
//Open the SFTP channel
//
channel = session.openChannel("sftp");
channel.connect();
c = (ChannelSftp)channel;
status = "OK";
}
catch (Exception e) {
status = "Unable to connect to FTP server. "+e.toString();
}
Log out is:
INFO: Connecting to X.X.X.X port 22
INFO: Connection established
INFO: Remote version string: SSH-2.0-6.4.13.36 SSH Tectia Server
INFO: Local version string: SSH-2.0-JSCH-0.1.53
INFO: CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
**INFO**: CheckKexes: diffie-hellman-group14-sha1,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521
CheckKexes: diffie-hellman-group14-sha1,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521
INFO: CheckSignatures: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
INFO: SSH_MSG_KEXINIT sent
INFO: SSH_MSG_KEXINIT received
**INFO: kex: server**: diffie-hellman-group14-sha256#ssh.com,diffie-hellman-group-exchange-sha256,diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1
INFO: kex: server: ssh-rsa,ssh-rsa-sha256#ssh.com
INFO: kex: server: aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc,crypticore128#ssh.com
INFO: kex: server: aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc,crypticore128#ssh.com
INFO: kex: server: hmac-sha2-256,hmac-sha2-512,hmac-md5,hmac-sha256-2#ssh.com,hmac-sha224#ssh.com,hmac-sha256#ssh.com,hmac-sha384#ssh.com,hmac-sha512#ssh.com,crypticore-mac#ssh.com
INFO: kex: server: hmac-sha2-256,hmac-sha2-512,hmac-md5,hmac-sha256-2#ssh.com,hmac-sha224#ssh.com,hmac-sha256#ssh.com,hmac-sha384#ssh.com,hmac-sha512#ssh.com,crypticore-mac#ssh.com
INFO: kex: server: none,zlib
INFO: kex: server: none,zlib
INFO: kex: server:
INFO: kex: server:
**INFO: kex: client**: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
INFO: kex: client: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
INFO: kex: client: aes256-ctr,aes192-ctr,arcfour,arcfour128,arcfour256,aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-cbc,aes256-cbc
INFO: kex: client: aes256-ctr,aes192-ctr,arcfour,arcfour128,arcfour256,aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-cbc,aes256-cbc
INFO: kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
INFO: kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
INFO: kex: client: none
INFO: kex: client: none
INFO: kex: client:
INFO: kex: client:
INFO: kex: server->client aes256-ctr hmac-md5 none
INFO: kex: client->server aes256-ctr hmac-md5 none
INFO: SSH_MSG_KEXDH_INIT sent
INFO: expecting SSH_MSG_KEXDH_REPLY
INFO: ssh_rsa_verify: signature true
INFO: Permanently added '160.58.9.72' (RSA) to the list of known hosts.
INFO: SSH_MSG_NEWKEYS sent
INFO: SSH_MSG_NEWKEYS received
INFO: SSH_MSG_SERVICE_REQUEST sent
INFO: SSH_MSG_SERVICE_ACCEPT received
INFO: Authentications that can continue: publickey,keyboard-interactive,password
INFO: Next authentication method: publickey
INFO: Authentications that can continue: keyboard-interactive,password
INFO: Next authentication method: keyboard-interactive
INFO: Authentication succeeded (keyboard-interactive).
I've tried to set the SHA256 algorithm by putting the same algorithms in the same order as the server logs without success:
config.put("kex", "diffie-hellman-group14-sha256#ssh.com,diffie-hellman-group-exchange-sha256,diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1");
Log when algorithm order is the same
INFO: Connecting to X.X.X.X port 22
INFO: Connection established
INFO: Remote version string: SSH-2.0-6.4.13.36 SSH Tectia Server
INFO: Local version string: SSH-2.0-JSCH-0.1.53
INFO: CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
INFO: CheckKexes: diffie-hellman-group14-sha1,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521
INFO: CheckSignatures: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
INFO: SSH_MSG_KEXINIT sent
INFO: SSH_MSG_KEXINIT received
INFO: kex: server: diffie-hellman-group14-sha256#ssh.com,diffie-hellman-group-exchange-sha256,diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1
INFO: kex: server: ssh-rsa,ssh-rsa-sha256#ssh.com
INFO: kex: server: aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc,crypticore128#ssh.com
INFO: kex: server: aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc,crypticore128#ssh.com
INFO: kex: server: hmac-sha2-256,hmac-sha2-512,hmac-md5,hmac-sha256-2#ssh.com,hmac-sha224#ssh.com,hmac-sha256#ssh.com,hmac-sha384#ssh.com,hmac-sha512#ssh.com,crypticore-mac#ssh.com
INFO: kex: server: hmac-sha2-256,hmac-sha2-512,hmac-md5,hmac-sha256-2#ssh.com,hmac-sha224#ssh.com,hmac-sha256#ssh.com,hmac-sha384#ssh.com,hmac-sha512#ssh.com,crypticore-mac#ssh.com
INFO: kex: server: none,zlib
INFO: kex: server: none,zlib
INFO: kex: server:
INFO: kex: server:
INFO: kex: client: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
INFO: kex: client: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
INFO: kex: client: aes256-ctr,aes192-ctr,arcfour,arcfour128,arcfour256,aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-cbc,aes256-cbc
INFO: kex: client: aes256-ctr,aes192-ctr,arcfour,arcfour128,arcfour256,aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-cbc,aes256-cbc
INFO: kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
INFO: kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
INFO: kex: client: none
INFO: kex: client: none
INFO: kex: client:
INFO: kex: client:
INFO: kex: server->client aes256-ctr hmac-md5 none
INFO: kex: client->server aes256-ctr hmac-md5 none
INFO: SSH_MSG_KEXDH_INIT sent
INFO: expecting SSH_MSG_KEXDH_REPLY
INFO: ssh_rsa_verify: signature true
INFO: Permanently added 'X.X.X.X' (RSA) to the list of known hosts.
INFO: SSH_MSG_NEWKEYS sent
INFO: SSH_MSG_NEWKEYS received
INFO: SSH_MSG_SERVICE_REQUEST sent
INFO: SSH_MSG_SERVICE_ACCEPT received
INFO: Authentications that can continue: publickey,keyboard-interactive,password
INFO: Next authentication method: publickey
INFO: Authentications that can continue: keyboard-interactive,password
INFO: Next authentication method: keyboard-interactive
INFO: Authentication succeeded (keyboard-interactive).
INFO: Disconnecting from X.X.X.X port 22
INFO: Caught an exception, leaving main loop due to Socket closed

Related

Firebase crashlytics mapping file is not uploading on a Ubuntu AWS container

I recently migrated to firebase-crashlytics-gradle from the deprecated Fabric library. It works properly on the local machine with these commands:
chmod +x ./gradlew
./gradlew clean
./gradlew assembleApplicationQa appDistributionUploadApplicationQa --debug
however, this is not working on the ubuntu container in the code build pipeline on AWS. The error that is showing is this one:
* What went wrong:
00:32:26.407 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution
failed for task ':app:uploadCrashlyticsMappingFileApplicationQa'.
00:32:26.407 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] >
java.io.FileNotFoundException:
/codebuild/output/src160981101/src/application/app/build/outputs/mapping/application/qa/mapping.txt
(No such file or directory)
00:32:26.407 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
I found that on the local there is a process in that task that is not happening con the ubuntu container: that is this one which seems like is reaching the Crashlytics server and uploads the file properly:
18:58:46.217 [DEBUG] [com.google.firebase.crashlytics] Uploading Mapping File [mappingFile: /Users/carlos/Desktop/Repo/Applicationandroid/Application/app/build/outputs/mapping/Application/qa/mapping.txt; mappingFileId: 764dc9b417f249f08823552e8e240186;packageName: com.Application.android.qa; googleAppId: 1:775166595613:android:604478ccade98840]
18:58:46.218 [DEBUG] [com.google.firebase.crashlytics] Zipping mapping file: /Users/carlos/Desktop/Repo/Applicationandroid/Application/app/build/outputs/mapping/Application/qa/mapping.txt -> /Users/carlos/Desktop/Repo/Applicationandroid/Application/app/build/crashlytics/ApplicationQa/mappings/764dc9b417f249f08823552e8e240186.gz
18:58:46.697 [DEBUG] [com.google.firebase.crashlytics] PUT file: /Users/carlos/Desktop/Repo/Applicationandroid/Application/app/build/crashlytics/ApplicationQa/mappings/764dc9b417f249f08823552e8e240186.gz to URL: https://firebasecrashlyticssymbols.googleapis.com/v1/project/-/app/1:775166595613:android:604478ccade98840/upload/java/764dc9b417f249f08823552e8e240186
18:58:46.698 [DEBUG] [com.google.firebase.crashlytics] PUT headers:
18:58:46.698 [DEBUG] [com.google.firebase.crashlytics] User-Agent = crashlytics-gradle/2.0.0
18:58:46.698 [DEBUG] [com.google.firebase.crashlytics] X-CRASHLYTICS-API-CLIENT-TYPE = crashlytics-gradle
18:58:46.698 [DEBUG] [com.google.firebase.crashlytics] X-CRASHLYTICS-API-CLIENT-VERSION = 2.0.0
18:58:46.698 [DEBUG] [org.apache.http.client.protocol.RequestAddCookies] CookieSpec selected: default
18:58:46.698 [DEBUG] [org.apache.http.client.protocol.RequestAuthCache] Auth cache not set in the context
18:58:46.699 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection request: [route: {s}->https://firebasecrashlyticssymbols.googleapis.com:443][total kept alive: 0; route allocated: 0 of 2; total allocated: 0 of 20]
18:58:46.699 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection leased: [id: 8][route: {s}->https://firebasecrashlyticssymbols.googleapis.com:443][total kept alive: 0; route allocated: 1 of 2; total allocated: 1 of 20]
18:58:46.699 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Opening connection {s}->https://firebasecrashlyticssymbols.googleapis.com:443
18:58:46.759 [DEBUG] [org.apache.http.impl.conn.DefaultHttpClientConnectionOperator] Connecting to firebasecrashlyticssymbols.googleapis.com/142.250.113.95:443
18:58:46.759 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Connecting socket to firebasecrashlyticssymbols.googleapis.com/142.250.113.95:443 with timeout 0
18:58:46.811 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Enabled protocols: [TLSv1.2, TLSv1.1, TLSv1]
18:58:46.811 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Enabled cipher suites:[TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_DSS_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV]
18:58:46.811 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Starting handshake
18:58:46.870 [DEBUG] [jdk.event.security] ValidationChain: 7087067, 1544128074,234213421
18:58:46.925 [DEBUG] [jdk.event.security] TLSHandshake: firebasecrashlyticssymbols.googleapis.com:443, TLSv1.2, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, 1528437816
18:58:46.925 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Secure session established
18:58:46.925 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] negotiated protocol: TLSv1.2
18:58:46.925 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] negotiated cipher suite: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
18:58:46.926 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] peer principal: CN=upload.video.google.com, O=Google LLC, L=Mountain View, ST=California, C=US
18:58:46.926 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] peer alternative names: [upload.video.google.com, *.clients.google.com, *.docs.google.com, *.drive.google.com, *.gdata.youtube.com, *.googleapis.com, *.photos.google.com, *.upload.google.com, *.upload.youtube.com, *.youtube-3rd-party.com, upload.google.com, upload.youtube.com, uploads.stage.gdata.youtube.com]
18:58:46.926 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] issuer principal: CN=GTS CA 1O1, O=Google Trust Services, C=US
18:58:46.926 [DEBUG] [org.apache.http.impl.conn.DefaultHttpClientConnectionOperator] Connection established 192.168.0.9:61946<->142.250.113.95:443
18:58:46.926 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Executing request PUT /v1/project/-/app/1:775166595613:android:604478ccade98840/upload/java/764dc9b417f249f08823552e8e240186 HTTP/1.1
18:58:46.926 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Target auth state: UNCHALLENGED
18:58:46.926 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Proxy auth state: UNCHALLENGED
18:58:51.688 [LIFECYCLE] [org.gradle.process.internal.health.memory.MemoryManager]
18:58:51.688 [DEBUG] [org.gradle.process.internal.health.memory.MemoryManager] Emitting OS memory status event {Total: 17179869184, Free: 6186242048}
18:58:51.688 [DEBUG] [org.gradle.launcher.daemon.server.health.LowMemoryDaemonExpirationStrategy] Received memory status update: {Total: 17179869184, Free: 6186242048}
18:58:51.688 [DEBUG] [org.gradle.process.internal.health.memory.MemoryManager] Emitting JVM memory status event {Maximum: 3817865216, Committed: 3571974144}
18:58:48.233 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger]
18:58:48.233 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :app:uploadCrashlyticsMappingFileAppicationQa
18:58:53.416 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Connection can be kept alive indefinitely
18:58:53.416 [DEBUG] [com.google.firebase.crashlytics] PUT response: [reqId=null] 200
18:58:53.416 [INFO] [com.google.firebase.crashlytics] Mapping file uploaded: /Users/hernandez/Desktop/Repo/Appicationandroid/Appication/app/build/outputs/mapping/Appication/qa/mapping.txt
18:58:53.416 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Execute uploadMappingFile for :app:uploadCrashlyticsMappingFileApplicationQa'
18:58:53.417 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Execute uploadMappingFile for :app:uploadCrashlyticsMappingFileApplicationQa' completed
18:58:53.417 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter] Removed task artifact state for {} from context.
18:58:53.417 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':app:uploadCrashlyticsMappingFileApplicationQa'
18:58:53.417 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Task :app:uploadCrashlyticsMappingFileApplicationQa'
18:58:53.417 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Task :app:uploadCrashlyticsMappingFileApplicationQa' completed
18:58:53.417 [INFO] [org.gradle.execution.taskgraph.DefaultTaskPlanExecutor] :app:uploadCrashlyticsMappingFileApplicationQa (Thread[Task worker for ':',5,main]) completed. Took 7.201 secs.
':': acquired lock on root.1.26
As you can see the process uploads the file and then completes, however in the ubuntu container it doesn't happen:
00:32:25.697 [INFO] [org.gradle.execution.taskgraph.DefaultTaskPlanExecutor] :app:uploadCrashlyticsMappingFileApplicationQa (Thread[Task worker for ':' Thread 7,5,main]) started.
00:32:25.697 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger]
00:32:25.697 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :app:uploadCrashlyticsMappingFileApplicationQa FAILED
00:32:25.697 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Task :app:uploadCrashlyticsMappingFileApplicationQa' started
00:32:25.697 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Starting to execute task ':app:uploadCrashlyticsMappingFileApplicationQa'
00:32:25.697 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter] Putting task artifact state for task ':app:uploadCrashlyticsMappingFileApplicationQa' into context took 0.0 secs.
00:32:25.697 [DEBUG] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Determining if task ':app:uploadCrashlyticsMappingFileApplicationQa' is up-to-date
00:32:25.697 [INFO] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Task ':app:uploadCrashlyticsMappingFileApplicationQa' is not up-to-date because:
Task has not declared any outputs despite executing actions.
00:32:25.697 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter] Executing actions for task ':app:uploadCrashlyticsMappingFileApplicationQa'.
00:32:25.697 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Execute uploadMappingFile for :app:uploadCrashlyticsMappingFileApplicationQa' started
00:32:25.701 [DEBUG] [com.google.firebase.crashlytics] Getting appId from output of the Google Services plugin at /codebuild/output/src160981101/src/Application/app/build/generated/res/google-services/Application/qa/values/values.xml
00:32:25.733 [DEBUG] [com.google.firebase.crashlytics] Found Google appId: 1:775166595613:android:604478ccade232432
00:32:25.741 [DEBUG] [com.google.firebase.crashlytics] Uploading Mapping File [mappingFile: /codebuild/output/src160981101/src/Application/app/build/outputs/mapping/Application/qa/mapping.txt; mappingFileId: 140f7e5865d146cdb1c49d4eae9d82b7;packageName: com.Application.android.qa; googleAppId: 1:775166595613:android:604478ccade232432]
00:32:25.742 [DEBUG] [com.google.firebase.crashlytics] Zipping mapping file: /codebuild/output/src160981101/src/Application/app/build/outputs/mapping/Application/qa/mapping.txt -> /codebuild/output/src160981101/src/Application/app/build/crashlytics/ApplicationQa/mappings/140f7e5865d146cdb1c49d4eae9d82b7.gz
00:32:25.742 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Execute uploadMappingFile for :app:uploadCrashlyticsMappingFileApplicationQa'
00:32:25.742 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Execute uploadMappingFile for :app:uploadCrashlyticsMappingFileApplicationQa' completed
00:32:25.743 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter] Removed task artifact state for {} from context.
00:32:25.743 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':app:uploadCrashlyticsMappingFileApplicationQa'
00:32:25.743 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Task :app:uploadCrashlyticsMappingFileApplicationQa'
00:32:25.743 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Task :app:uploadCrashlyticsMappingFileApplicationQa' completed
00:32:25.743 [INFO] [org.gradle.execution.taskgraph.DefaultTaskPlanExecutor] :app:uploadCrashlyticsMappingFileApplicationQa (Thread[Task worker for ':' Thread 7,5,main]) completed. Took 0.045 secs.
So I really don't know what if going on, but this is breaking the pipeline because is not compiling, if I set the flag on the Gradle file of mappingFileUploadEnabled to false:
mappingFileUploadEnabled false
the project is compiling successfully but, when it is set to true it is not.
So seems like the problem is firebase is not reaching its server but I don't know why, the container doesn't have any IP restriction to firebase
Thank you for your help I really appreciate it!
After several days of doing this, I discovered that the problem is related to Crashlytics and the Gradle version if you use this configuration:
Docker Image for building the project: standard/ubuntu4:0 from this place
Gradle version: 4.10.3 and android Gradle plugin 3.3.3
Any version of Crashlytics from 17.0.0 and up
Progurad must be enabled and the flag to upload the mapping file to Crashlycts must be true
Then run the project and the project will crash.
The solution is to upgrade the Gradle version to 5.1.1 and the project will run properly, a code example is here
You can see through the comments, how the project evolved.

SFTP File Transfer not being received by client

We recently performed a new deployment of our system which included an upgrade of Apache Commons VFS from 1.1 to 2.0. Since the deployment our client has said they are no longer receiving a file that is generated by our system on a daily basis and transferred to their server over sftp. All of our logs seem to indicate no problem:
DEBUG 2019-05-06 16:30:22,237 VfsLog:70 debug-> Using "/home/tomcat/var/tomcat/temp/vfs_cache" as temporary files store.
DEBUG 2019-05-06 16:30:22,248 VfsLog:70 debug-> Skipping provider "org.apache.commons.vfs2.provider.webdav.WebdavFileProvider" because required class "org.apache.jackrabbit.webdav.client.methods.DavMethod" is not available.
DEBUG 2019-05-06 16:30:22,250 VfsLog:70 debug-> Skipping provider "org.apache.commons.vfs2.provider.hdfs.HdfsFileProvider" because required class "org.apache.hadoop.fs.FileSystem" is not available.
DEBUG 2019-05-06 16:30:22,262 Transporter:525 getFSOptions-> Not using strict host checking
DEBUG 2019-05-06 16:30:22,262 Transporter:528 getFSOptions-> user dir as root? true
DEBUG 2019-05-06 16:30:22,263 Transporter:214 transportOutbound-> Attempting to write to remote file [server]/[file].pgp
DEBUG 2019-05-06 16:30:22,264 VfsLog:70 debug-> Using "/home/tomcat/var/tomcat/temp/vfs_cache" as temporary files store.
DEBUG 2019-05-06 16:30:22,267 VfsLog:70 debug-> Skipping provider "org.apache.commons.vfs2.provider.webdav.WebdavFileProvider" because required class "org.apache.jackrabbit.webdav.client.methods.DavMethod" is not available.
DEBUG 2019-05-06 16:30:22,268 VfsLog:70 debug-> Skipping provider "org.apache.commons.vfs2.provider.hdfs.HdfsFileProvider" because required class "org.apache.hadoop.fs.FileSystem" is not available.
INFO 2019-05-06 16:30:22,372 SftpClientFactory$JSchLogger:324 log-> Connecting to [server] port 22
INFO 2019-05-06 16:30:22,394 SftpClientFactory$JSchLogger:324 log-> Connection established
INFO 2019-05-06 16:30:22,398 SftpClientFactory$JSchLogger:324 log-> Remote version string: SSH-2.0-Maverick_SSHD
INFO 2019-05-06 16:30:22,398 SftpClientFactory$JSchLogger:324 log-> Local version string: SSH-2.0-JSCH-0.1.54
INFO 2019-05-06 16:30:22,399 SftpClientFactory$JSchLogger:324 log-> CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
INFO 2019-05-06 16:30:22,430 SftpClientFactory$JSchLogger:324 log-> CheckKexes: diffie-hellman-group14-sha1,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521
INFO 2019-05-06 16:30:22,525 SftpClientFactory$JSchLogger:324 log-> CheckSignatures: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
INFO 2019-05-06 16:30:22,535 SftpClientFactory$JSchLogger:324 log-> SSH_MSG_KEXINIT sent
INFO 2019-05-06 16:30:22,536 SftpClientFactory$JSchLogger:324 log-> SSH_MSG_KEXINIT received
INFO 2019-05-06 16:30:22,536 SftpClientFactory$JSchLogger:324 log-> kex: server: diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1
INFO 2019-05-06 16:30:22,537 SftpClientFactory$JSchLogger:324 log-> kex: server: ssh-rsa
INFO 2019-05-06 16:30:22,537 SftpClientFactory$JSchLogger:324 log-> kex: server: aes256-cbc,aes192-cbc,aes128-cbc
INFO 2019-05-06 16:30:22,538 SftpClientFactory$JSchLogger:324 log-> kex: server: aes256-cbc,aes192-cbc,aes128-cbc
INFO 2019-05-06 16:30:22,539 SftpClientFactory$JSchLogger:324 log-> kex: server: hmac-sha1,hmac-sha1-96,hmac-md5-96
INFO 2019-05-06 16:30:22,539 SftpClientFactory$JSchLogger:324 log-> kex: server: hmac-sha1,hmac-sha1-96,hmac-md5-96
INFO 2019-05-06 16:30:22,540 SftpClientFactory$JSchLogger:324 log-> kex: server: none
INFO 2019-05-06 16:30:22,540 SftpClientFactory$JSchLogger:324 log-> kex: server: none
INFO 2019-05-06 16:30:22,541 SftpClientFactory$JSchLogger:324 log-> kex: server:
INFO 2019-05-06 16:30:22,541 SftpClientFactory$JSchLogger:324 log-> kex: server:
INFO 2019-05-06 16:30:22,542 SftpClientFactory$JSchLogger:324 log-> kex: client: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
INFO 2019-05-06 16:30:22,543 SftpClientFactory$JSchLogger:324 log-> kex: client: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
INFO 2019-05-06 16:30:22,543 SftpClientFactory$JSchLogger:324 log-> kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-ctr,aes192-cbc,aes256-ctr,aes256-cbc
INFO 2019-05-06 16:30:22,544 SftpClientFactory$JSchLogger:324 log-> kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-ctr,aes192-cbc,aes256-ctr,aes256-cbc
INFO 2019-05-06 16:30:22,544 SftpClientFactory$JSchLogger:324 log-> kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
INFO 2019-05-06 16:30:22,545 SftpClientFactory$JSchLogger:324 log-> kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
INFO 2019-05-06 16:30:22,545 SftpClientFactory$JSchLogger:324 log-> kex: client: none
INFO 2019-05-06 16:30:22,546 SftpClientFactory$JSchLogger:324 log-> kex: client: none
INFO 2019-05-06 16:30:22,547 SftpClientFactory$JSchLogger:324 log-> kex: client:
INFO 2019-05-06 16:30:22,547 SftpClientFactory$JSchLogger:324 log-> kex: client:
INFO 2019-05-06 16:30:22,548 SftpClientFactory$JSchLogger:324 log-> kex: server->client aes128-cbc hmac-sha1 none
INFO 2019-05-06 16:30:22,548 SftpClientFactory$JSchLogger:324 log-> kex: client->server aes128-cbc hmac-sha1 none
INFO 2019-05-06 16:30:22,567 SftpClientFactory$JSchLogger:324 log-> SSH_MSG_KEX_DH_GEX_REQUEST(1024<2048<2048) sent
INFO 2019-05-06 16:30:22,568 SftpClientFactory$JSchLogger:324 log-> expecting SSH_MSG_KEX_DH_GEX_GROUP
INFO 2019-05-06 16:30:22,591 SftpClientFactory$JSchLogger:324 log-> SSH_MSG_KEX_DH_GEX_INIT sent
INFO 2019-05-06 16:30:22,592 SftpClientFactory$JSchLogger:324 log-> expecting SSH_MSG_KEX_DH_GEX_REPLY
INFO 2019-05-06 16:30:22,620 SftpClientFactory$JSchLogger:324 log-> ssh_rsa_verify: signature true
INFO 2019-05-06 16:30:22,622 SftpClientFactory$JSchLogger:324 log-> Host '[server]' is known and matches the RSA host key
INFO 2019-05-06 16:30:22,623 SftpClientFactory$JSchLogger:324 log-> SSH_MSG_NEWKEYS sent
INFO 2019-05-06 16:30:22,624 SftpClientFactory$JSchLogger:324 log-> SSH_MSG_NEWKEYS received
INFO 2019-05-06 16:30:22,632 SftpClientFactory$JSchLogger:324 log-> SSH_MSG_SERVICE_REQUEST sent
INFO 2019-05-06 16:30:22,635 SftpClientFactory$JSchLogger:324 log-> SSH_MSG_SERVICE_ACCEPT received
INFO 2019-05-06 16:30:22,642 SftpClientFactory$JSchLogger:324 log-> Authentications that can continue: publickey,keyboard-interactive,password
INFO 2019-05-06 16:30:22,642 SftpClientFactory$JSchLogger:324 log-> Next authentication method: publickey
INFO 2019-05-06 16:30:22,719 SftpClientFactory$JSchLogger:324 log-> Authentications that can continue: password
INFO 2019-05-06 16:30:22,719 SftpClientFactory$JSchLogger:324 log-> Next authentication method: password
INFO 2019-05-06 16:30:22,736 SftpClientFactory$JSchLogger:324 log-> Authentication succeeded (password).
DEBUG 2019-05-06 16:30:22,758 SoftRefFilesCache:130 putFile-> putFile: sftp://[user]:***#[server]/[filename].pgp
DEBUG 2019-05-06 16:30:23,143 SoftRefFilesCache:130 putFile-> putFile: sftp://[user]:***#[server]/
DEBUG 2019-05-06 16:30:23,181 SoftRefFilesCache:130 putFile-> putFile: sftp://[user]:***#[server]/TO_HR
DEBUG 2019-05-06 16:30:23,443 Transporter:220 transportOutbound-> Completed write to remote file [server]/TO_HR/[file].pgp
INFO 2019-05-06 16:30:23,444 SftpClientFactory$JSchLogger:324 log-> Disconnecting from [server] port 22
And this is the generic piece of code we have to perform transfers like this:
String safeUri = escapePassword(uriString, events);
String hostPath = getHostPath(uriString);
FileSystemManager fsManager = getFileSystemManager();
try {
FileSystemOptions opts = getFSOptions();
FileObject remoteFile = fsManager.resolveFile(safeUri + remoteFilename, opts);
IOUtils.copy(new FileInputStream(localFile), remoteFile.getContent().getOutputStream());
catch(IOException ioe) {
log.error("", ioe);
} finally {
close(fsManager);
}
The file is generated and stored on the server successfully, and we can manually transfer the file to the client using the server's sftp command (the server is CentOS 6 so I assume it's OpenSSH) using the same user credentials used by the application.
Any ideas on what might be going wrong?
Ended up rewriting our sftp file transfer code using the answer here: https://stackoverflow.com/a/14830708/3415090

ASP.NET Core with React - 431 Request headers too long

I have a dotnet application that I start with the dotnet run command. I also have a React app, that I start with yarn start.
When I open the browser on localhost:3000 (where the react app is) the server log looks like this:
....this goes on for long
Request starting HTTP/1.1 GET http://localhost:5000/build/bundle.js
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost:5000/build/bundle.js
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost:5000/build/bundle.js
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost:5000/build/bundle.js
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost:5000/build/bundle.js
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost:5000/build/bundle.js
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost:5000/build/bundle.js
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost:5000/build/bundle.js
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost:5000/build/bundle.js
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost:5000/build/bundle.js
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost:5000/build/bundle.js
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost:5000/build/bundle.js
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost:5000/build/bundle.js
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost:5000/build/bundle.js
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost:5000/build/bundle.js
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost:5000/build/bundle.js
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost:5000/build/bundle.js
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost:5000/build/bundle.js
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost:5000/build/bundle.js
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost:5000/build/bundle.js
info: Microsoft.AspNetCore.Server.Kestrel[17]
Connection id "0HLMFVTO65C53" bad request data: "Request headers too long."
Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Request headers too long.
at Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException.Throw(RequestRejectionReason reason)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1Connection.TakeMessageHeaders(ReadOnlySequence`1 buffer, SequencePosition& consumed, SequencePosition& examined)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1Connection.ParseRequest(ReadOnlySequence`1 buffer, SequencePosition& consumed, SequencePosition& examined)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1Connection.TryParseRequest(ReadResult result, Boolean& endConnection)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequestsAsync[TContext](IHttpApplication`1 application)
After like 15 seconds of this the page loads, but I get an error in the browser console about the bundle.js 431 error.
If I make the RequestHeaders max total size larger for the Kestrel server, the same thing happens but this goes on for even longer and the end result is a 500 server error instead of 431.
Moreover if I try to make a simple DELETE request to the server using postman the result is pretty much the same. As if the request was stuck in an infinite loop and then returns a 431.
Lines from Startup.cs that might be relevant:
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
// In production, the React files will be served from this directory
services.AddSpaStaticFiles(configuration =>
{
configuration.RootPath = "client/build";
}
);
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller}/{action=Index}/{id?}");
}
);
app.UseSpaStaticFiles();
app.UseSpa(spa =>
{
if (env.IsDevelopment())
spa.UseProxyToSpaDevelopmentServer("http://localhost:3000");
}
);
What is going on?
I ran into the same issue, but with Angular, using asp.net core during localhost dev. The solution for me was to set the header size for node in the "start" script inside of my package.json file.
Inside scripts json object:
"start": "node --max-http-header-size=100000 ./node_modules/#angular/cli/bin/ng serve",

Why .net core hosted on Linux prepends a backslash on urls's hostnames?

In the log of my .net core app I can see that the URLs for all requests are prepended with a backslash. The application is hosted on Amazon Linux 2 using .net core 2.0. Here is how the url is used in the request: http://www.mvc.meetcorepoint.com/ and here is the url received by .net core http://\www.mvc.meetcorepoint.com/. Here is a part of the log that show this for other urls too:
dotnet-ids.mvc[22185]: info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
dotnet-ids.mvc[22185]: Request starting HTTP/1.1 GET http://\www.mvc.meetcorepoint.com/
dotnet-ids.mvc[22185]: info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1]
dotnet-ids.mvc[22185]: Executing action method MvcClient.Controllers.HomeController.Index (MvcClient) with arguments ((null)) -
dotnet-ids.mvc[22185]: info: Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.ViewResultExecutor[1]
dotnet-ids.mvc[22185]: Executing ViewResult, running view at path /Views/Home/Index.cshtml.
dotnet-ids.mvc[22185]: info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2]
dotnet-ids.mvc[22185]: Executed action MvcClient.Controllers.HomeController.Index (MvcClient) in 0.5249ms
dotnet-ids.mvc[22185]: info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
dotnet-ids.mvc[22185]: Request finished in 0.7982ms 200 text/html; charset=utf-8
dotnet-ids.mvc[22185]: info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
dotnet-ids.mvc[22185]: Request starting HTTP/1.1 GET http://\www.mvc.meetcorepoint.com/lib/bootstrap/dist/css/bootstrap.css
dotnet-ids.mvc[22185]: info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
dotnet-ids.mvc[22185]: Sending file. Request path: '/lib/bootstrap/dist/css/bootstrap.css'. Physical path: '/var/www/dotnet/ids
dotnet-ids.mvc[22185]: info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
dotnet-ids.mvc[22185]: Request finished in 1.6629ms 200 text/css
dotnet-ids.mvc[22185]: info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
dotnet-ids.mvc[22185]: Request starting HTTP/1.1 GET http://\www.mvc.meetcorepoint.com/css/site.css
dotnet-ids.mvc[22185]: info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
dotnet-ids.mvc[22185]: Sending file. Request path: '/css/site.css'. Physical path: '/var/www/dotnet/ids.mvc/wwwroot/css/site.cs
dotnet-ids.mvc[22185]: info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
dotnet-ids.mvc[22185]: Request finished in 0.3626ms 200 text/css
As it turns out this had nothing to do with Linux, nor with .net core itself. The problem was in my nginx configuration which is used as a reverse proxy to the .net core application. When I was coping the proxy nginx configuration from the web, it somehow prepended a backslash on the Upgrade and Host headers. So instead of having proxy_set_header Host $host; I had used proxy_set_header Host \$host;

firebase init gives EPROTO error

Running firebase init command gives an EPROTO error. Same error when I try firebase list. I can successfully use firebase login though. Here is the output of the firebase.debug.log:
[debug] ----------------------------------------------------------------------
[debug] Command: C:\Program Files\nodejs\node.exe C:\Users\andre\AppData\Roaming\npm\node_modules\firebase-tools\bin\firebase init
[debug] CLI Version: 3.13.1
[debug] Platform: win32
[debug] Node Version: v8.8.1
[debug] Time: Sat Oct 28 2017 12:35:18 GMT+0100 (GMT Summer Time)
[debug] ----------------------------------------------------------------------
[debug]
[debug] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase"]
[debug] [2017-10-28T11:35:18.899Z] > authorizing via signed-in user
You're about to initialize a Firebase project in this directory:
C:\Users\andre\Documents\cake-poly20-test
[info]
=== Project Setup
[info]
[info] First, let's associate this project directory with a Firebase project.
[info] You can create multiple project aliases by running firebase use --add,
[info] but for now we'll just set up a default project.
[info]
[debug] > refreshing access token with scopes: ["email","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","openid"]
[debug] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token { refresh_token: '<token>',
client_id: '<clientid>.apps.googleusercontent.com',
client_secret: '<secret>',
grant_type: 'refresh_token',
scope: 'email https://www.googleapis.com/auth/cloudplatformprojects.readonly https://www.googleapis.com/auth/firebase openid' }
Sat Oct 28 2017 12:35:25 GMT+0100 (GMT Summer Time)
[debug] <<< HTTP RESPONSE 200
[debug] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects
Sat Oct 28 2017 12:35:25 GMT+0100 (GMT Summer Time)
[debug] Error: write EPROTO 101057795:error:140773E8:SSL routines:SSL23_GET_SERVER_HELLO:reason(1000):openssl\ssl\s23_clnt.c:772:
at _errnoException (util.js:1024:11)
at WriteWrap.afterWrite [as oncomplete] (net.js:870:14)
[error]
[error] Error: Server Error. write EPROTO 101057795:error:140773E8:SSL routines:SSL23_GET_SERVER_HELLO:reason(1000):openssl\ssl\s23_clnt.c:772:
Cause:
Eventually I found that my ISP had updated its so-called Kids Safe security settings and was treating admin.firebase.com as a blocked file sharing site.
Solution:
I updated my settings in the ISPs config, so that access to firebase.com was always allowed. Now firebase init, firebase list etc are working fine.

Resources