Allow HTTP download in Android Studio - gradle

I am getting the following error in Android Studio:
> Could not download builder-4.1.2.jar (com.android.tools.build:builder:4.1.2)
> Could not get resource 'http://10.252.250.53:8081/lm/content/groups/public/com/android/tools/build/builder/4.1.2/builder-4.1.2.jar'.
> Could not GET 'http://10.252.250.53:8081/lm/content/groups/public/com/android/tools/build/builder/4.1.2/builder-4.1.2.jar'.
> Connect to 10.252.250.53:8081 [/10.252.250.53] failed: Connection timed out: connect
I am able to download the file from that link in a browser. So I believe the issue is that Android Studio is not allowing HTTP download.
Please guide.

The file you download is quite outdated; this is version 7.0.2 meanwhile.
Either add a self-signed SSL certificate to 10.252.250.53:8081 + local machine and define a proxy:
systemProp.https.proxyHost=10.252.250.53
systemProp.https.proxyPort=8081
Or downgrade back to Gradle < 7.0 ...if you really want to use HTTP (which is merely dead already).

Related

Arduino IDE falied to connect Blynk USB

Im using Arduino IDE to connect blink cloud with my Smartphone, but when I run the tools> Blynk > Run USB script I receive the flowing message:
socat[11716] E SSL_connect(): error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
I find how to solve this problem (Only for studies propose). In Arduino Home folder, I go to libraries->Blynk->scripts, I open the blynk-ser.sh in a text editor and search for line when socat is used, i find this
socat $GEN_ATTR "$FROM_ATTR" "$TO_ATTR"
So, I change to
socat $GEN_ATTR "$FROM_ATTR" "$TO_ATTR",verify=0
This issue is because in the certs folder client.pem is missing, I dont find how to generate this, but, I avoid ssl validation for the connection.
WARN: DO NOT USE THIS TIP IN PRODUCTION, BECAUSE YOU WILL MAKE YOUR PROJECT UNSAFE

identityserver4 the remote certificate is invalid because of errors in the certificate chain: untrustedroot

I am hosting my IdentityServer, Web API and MVC client apps all with IIS server, under HTTPS. When I run the my MVC client I get the following error back (note - 6009 is the port of my MVC client and 6005 is the port of my IdentityServer):
I am using IIS Express Development Certificate for all projects when I configure them in IIS:
and I copied the certificate from the personal store to the trusted root as the following:
and here is the details of the cert:
what else am I missing here?
You can refer to the official link,and try the commands in it.
dotnet dev-certs https --clean
dotnet dev-certs https --trust
For me, neither dotnet dev-certs https --clean/trust nor manually cleaning the Windows certificate stores worked out.
Since I was using Docker and Kestrel (instead of ISS), for some reason, it was using outdated certificates located under: C:\Users\<user>\AppData\Roaming\ASP.NET\Https\<project-name>.pfx The dotnet dev-certs https --clean command did not clean up the certificates in this directory.
After cleaning the certificates in this directory, everything worked again. I'm aware that your problem is already resolved, but since this is a common issue I figured I would also post my solution here.
Related issue about why the clean command does not clean these certs can be found here: https://github.com/dotnet/aspnetcore/issues/15357

Jenkins unable to download xamarin dependency from dl.google.com / maven.google.com

Jenkins unable to download xamarin dependency from dl.google.com / maven.google.com
Download failure reason: Unable to connect to the remote server
Project stack
Dotnet Xamarin android application
Error
Downloading https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-core/16.0.1/firebase-core-16.0.1.aar to C:\Windows\system32\config\systemprofile\AppData\Local\XamarinBuildDownloadCache\googlefb-16.0.1/firebasecore.aar
C:\Windows\system32\config\systemprofile\.nuget\packages\xamarin.build.download\0.8.0\build\Xamarin.Build.Download.targets(52,3): error XBD001: Download failed. Please download https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-core/16.0.1/firebase-core-16.0.1.aar to a file called C:\Windows\system32\config\systemprofile\AppData\Local\XamarinBuildDownloadCache\googlefb-16.0.1/firebasecore.aar. [D:\myfolder\Jenkins\workspace\projectname\project\project.Android\project.Android.csproj]
Download failure reason: Unable to connect to the remote server
Downloading https://maven.google.com/com/crashlytics/sdk/android/crashlytics-core/2.6.3/crashlytics-core-2.6.3.aar to C:\Windows\system32\config\systemprofile\AppData\Local\XamarinBuildDownloadCache\crashlyticscore-2.6.3.aar
C:\Windows\system32\config\systemprofile\.nuget\packages\xamarin.build.download\0.8.0\build\Xamarin.Build.Download.targets(52,3): error XBD001: Download failed. Please download https://maven.google.com/com/crashlytics/sdk/android/crashlytics-core/2.6.3/crashlytics-core-2.6.3.aar to a file called C:\Windows\system32\config\systemprofile\AppData\Local\XamarinBuildDownloadCache\crashlyticscore-2.6.3.aar. [D:\myfolder\Jenkins\workspace\projectname\project\project.Android\project.Android.csproj]
Download failure reason: Unable to connect to the remote server
I have tried configured corporate proxy in Jenkins. it works on the proxy configuration page but throws an error while building code. See in the below screenshot.

Running Android Studio with an HTTP Proxy

I just downloaded and installed the latest version of Android Studio (3.0.1) at work to start a new tablet project. During setup it needed me to enter my proxy server information which I did. I created an empty project and it asked me to accept or reject a couple of certificates one from Google Inc (*.google.com) and another from JetBrains s.r.o. (plugins.jetbrains.com). I accepted them and they now show up in Settings -> Tools -> Server Certificates. It has been able to download a number of packages, but after everything appears to be installed I get a message "Gradle project sync failed. Basic functionality will not work properly."
There are a number of error messages that look like this:
Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0.
Could not resolve com.android.support:appcompat-v7:26.1.0.
Required by:
project :app
> Could not resolve com.android.support:appcompat-v7:26.1.0.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom'.
> dl.google.com
I tried adding http and https proxy server information to the 'gradle.properties' as suggested here.
That changed the error message to this:
Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0.
Could not resolve com.android.support:appcompat-v7:26.1.0.
Required by:
project :app
> Could not resolve com.android.support:appcompat-v7:26.1.0.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> unable to find valid certification path to requested target
Further digging came up with this. Adding the URL to FireFox allows me to download the appcompat-v7-26.1.0.pom file but does not provide a "HTTPS certificate chain" to export a certificate from. I am also not sure where I am supposed to get the keytool mentioned as well.
To verify that it is the proxy setup that is causing the problem I took my laptop home. Using my home network and turning off the HTTP Proxy caused a 3rd error (connection timed out) which was fixed by clearing the certificates. So it appears that the certificates accepted in Android Studio are used by at least part of the process. Now that I am back at work everything seems to work just fine.
There must be others out there running Android Studio with an HTTP Proxy set. What is the "correct" way of fixing this?
I replaced the file
C:\Program Files\Android\Android Studio\jre\jre\lib\security>\cacerts
with the file from the jre (%JAVA_HOME%\lib\security\cacerts).
The certificates in the new cacerts file directed the android jre to go through the proxy server.

Visual studio apache cordova remote ios connection hostanme/ip does not match issue

I use Visual Studio Apache Cordova for a hybrid application. I try to connect a Mac computer using remote connection. I made settings correctly. A few days ago, ip address of Mac computer has changed. And ı can not connect Mac computer with remote connection. It gives below error:
Error: An error occurred uploading to the build server https://192.168.95.26:3000/cordova: Error: Hostname/IP doesn't match certificate's altnames: "IP: 192.168.95.12 is not in the cert's list , 192.168.95.87"
Try to do following steps.
First on Mac terminal give this command
remotebuild --secure false
Then find the IP address of the Mac.
Go to the Tools->Options of visual studio
In the Options dialog box, open Tools for Apache Cordova, and then choose iOS Configuration.
Give the IP of Mac in Host and Port as 3000. Then put secure mode to false
More details could be found from this link https://taco.visualstudio.com/en-us/docs/ios-guide/
Error: An error occurred uploading to the build server https://192.168.95.26:3000/cordova: Error: Hostname/IP doesn't match certificate's altnames: "IP: 192.168.95.12 is not in the cert's list , 192.168.95.87"
It is a known issue. When the IP address changed, the previously generated certificate become invalid. You can fix this by following steps:
Stop the remote agent on your Mac.
In terminal run remotebuild certificates reset.
In terminal run remotebuild certificates generate.
Change the VS remote build configurations in VS.
For details, you can refer to Possible issue 2: The host name or IP address of your Mac has changed.

Resources