gradlew.bat (and gradlew) SSLHandShakeException - gradle

I'm new to Gradle and was going through this Spring Tutorial found here:
http://spring.io/guides/gs/gradle/
I get to the part where it tells me to add this task:
task wrapper(type: Wrapper) {
gradleVersion = '2.3'
}
I run gradle wrapper which creates the gradlew and gradlew.bat files.
Trying to run both of this I get this exception:
Downloading https://services.gradle.org/distributions/gradle-2.3-bin.zip
Exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.val
idator.ValidatorException: PKIX path building failed: sun.security.provider.cert
path.SunCertPathBuilderException: unable to find valid certification path to req
uested target
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1884)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:276)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:270)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.
java:1341)
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.jav
a:153)
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:868)
at sun.security.ssl.Handshaker.process_record(Handshaker.java:804)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1016)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.
java:1312)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1339
)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1323
)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:
563)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect
(AbstractDelegateHttpsURLConnection.java:185)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
nection.java:1300)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Http
sURLConnectionImpl.java:254)
at org.gradle.wrapper.Download.downloadInternal(Download.java:56)
at org.gradle.wrapper.Download.download(Download.java:42)
at org.gradle.wrapper.Install$1.call(Install.java:57)
at org.gradle.wrapper.Install$1.call(Install.java:44)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc
essManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:44)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:126)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:56)
Caused by: sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find vali
d certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:385)
at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.jav
a:292)
at sun.security.validator.Validator.validate(Validator.java:260)
at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.j
ava:326)
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerIm
pl.java:231)
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustMan
agerImpl.java:126)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.
java:1323)
... 19 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to
find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCert
PathBuilder.java:196)
at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:268)
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:380)
... 25 more
I try to hit the webserver at https://services.gradle.org/distributions/gradle-2.3-bin.zip and I'm not getting any sort of error. I'm I missing some sort of config? Any help would be appreciated. Thanks!

if you could not fix anyway. and if you are inside firewall.
then.
you may can not download https.
should fix that Edit gradle-wrapper.properties file.
vi [project]/gradle/wrapper/gradle-wrapper.properties
#distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-bin.zip
distributionUrl=http\://services.gradle.org/distributions/gradle-2.8-bin.zip
change from https to http...
http://blog.cjred.net/gradlew-bat-and-gradlew-sslhandshakeexception/
After I modified, it says: Server returned HTTP response code: 403 for URL: http://services.gradle.org/distributions/gradle-6.0.1-all.zip

I experienced the same problem, however my symptoms were that my Ubuntu machine couldn't resolve any SSL hosts unless I specifically added them to Java's certificate authority (cacert) file.
I stumbled upon this Debian bug, and found a fairly straight-forward resolution: remove ca-certificates-java and install it again:
sudo dpkg --purge --force-depends ca-certificates-java
sudo apt-get install ca-certificates-java
I did a ./gradlew clean for good measure, and everything sprung to life again.

It seems, that the certificates for the gradle site were messed up. Doing a gradlew clean should fix this. See this thread on the Gradle forum: http://discuss.gradle.org/t/urgent-ssl-apache-configuration-for-services-gradle-org-is-bad/8808/4

Steps:
Run gradlew -Djavax.net.debug=all tasks
Go through the debug logs, and see if you find anything out of the ordinary.
In my case, seeing something like Zscaler did the trick, as i know i have Zscaler on(which by the way rewrites the TLS traffic blablabla), and it was trying to find the valid certification path to requested target, which obviously it couldn't find.
2 Options:
Exit Zscaler
If exiting Zscaler is not an option, go to your browser, export Zscaler Root Certificate
If you are using Brave browser, here are the steps:
Settings > Privacy and security > Manage device certificates > Trusted Root Certification Authorities > Find Zscaler Root CA > Export
and import it in the JVM truststore gradle is using, something like:
keytool -import -trustcacerts -alias Zscaler -file "Zscaler Root CA.cer" -keystore "%JAVA_HOME%"\jre\lib\security\cacerts
IMPORTANT: Do a gradlew clean before retrying any command.

In my case the problem was caused by an obsolete (7 years old) version of Java. Even gradlew clean did fail. After a Java update it worked fine.

In my case I was on a company network and behind a proxy, which as I understand it rewrites the SSL certificates, making the Java installation not trust any of them.
To solve it I had to create a gradle.properties file in my home directory under .gradle (~/.gradle/gradle.properties) and add the following line:
org.gradle.jvmargs=-DsystemProp.https.proxyHost=<myProxyHost> -DsystemProp.https.proxyPort=<myProxyPort> -DsystemProp.https.proxyUser=<myProxyUsername> -DsystemProp.https.proxyPassword=<myProxyPassword>
That solution was based on this SO answer: Gradle use certificate authentication for repository

This is because, Gradle tries to find the installed package in your local machine.
If you have the installed location:
D:\apps\gradle-3.3
Follow these steps in eclipse:
New Project
Gradle Project
Enter project Name
Local Installation Directory
Click Finish.
You are good to go.

Create this profile in user home:
$ vi ~/.yarnrc
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
strict-ssl false

Related

Yarn 2.0: unable to get local issuer certificate

Attempting to migrate to yarn 2.0 and run into a problem with private npm packages resulting in
YN0001: │ GotError: unable to get local issuer certificate
Got around this in yarn 1.x with the strict-ssl: false config setting. Is there a way of doing something similar in the new .yarnrc.yml? Couldn't find anything related in the docs.
My .yarnrc.yml:
yarnPath: .yarn/releases/yarn-sources.js
npmScopes:
companyName:
npmRegistryServer: "https://www.myget.org/F/companyName/npm"

Yocto build broken when setting a remote rpm repository with https

I have generated a Yocto image to be used on all my target devices. When that image is running on target devices, it must be able to be updated using a rpm remote repository through https protocol.
To try doing that, I have added a dnf bbappend to my custom layer:
$ cat recipes-devtools/dnf/dnf_%.bbappend
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI += " \
file://yocto-adv-rpm.repo \
"
do_install_append () {
install -d ${D}/etc/yum.repos.d
install -m 0600 ${WORKDIR}/yocto-adv-rpm.repo ${D}/etc/yum.repos.d/yocto-adv-rpm.repo
}
FILES_${PN} += "/etc/yum.repos.d"
This is the content of repository configuration file included by dnf bbappend recipe:
$ cat recipes-devtools/dnf/files/yocto-adv-rpm.repo
[yocto-adv-rpm]
name=Rocko Yocto Repo
baseurl=https://storage.googleapis.com/my_repo/
gpgkey=https://storage.googleapis.com/my_repo/PACKAGEFEED-GPG-KEY-rocko
enabled=1
gpgcheck=1
This repository configuration breaks the build process of the image. When I try to build myimage recipe, I always get this error:
ERROR: myimage-1.0-r0 do_rootfs: [log_check] myimage: found 1 error message in the logfile:
[log_check] Failed to synchronize cache for repo 'yocto-adv-rpm', disabling.
ERROR: myimage-1.0-r0 do_rootfs: Function failed: do_rootfs
ERROR: Logfile of failure stored in: /home/yocto/yocto/build/tmp/work/machine-poky-linux/myimage/1.0-r0/temp/log.do_rootfs.731
ERROR: Task (/home/yocto/yocto/sources/meta-mylayer/recipes-images/myimage.bb:do_rootfs) failed with exit code '1'
However, when I replace the "https" by "http" in "baseurl" variable:
baseurl=http://storage.googleapis.com/my_repo/
Then the myimage recipe is built fine.
The host machine can download files from the https repository using wget:
$ wget https://storage.googleapis.com/my_repo/PACKAGEFEED-GPG-KEY-rocko
Previous commands works fine, so the problem is not related with the host machine, I think it must be something related with google certificates and yocto stuff.
I found some relevant information inside this file:
yocto/build/tmp/work/machine-poky-linux/myimage/1.0-r0/temp/dnf.librepo.log
The relevant part:
15:56:41 lr_download: Downloading started
15:56:41 check_transfer_statuses: Transfer finished: repodata/repomd.xml (Effective url: https://storage.googleapis.com/my_repo/repodata/repomd.xml)
15:56:41 check_finished_transfer_status: Fatal error - Curl code (77): Problem with the SSL CA cert (path? access rights?) for https://storage.googleapis.com/my_repo/repodata/repomd.xml [error setting certificate verify locations:
CAfile: /home/yocto/yocto/build/tmp/work/x86_64-linux/curl-native/7.54.1-r0/recipe-sysroot-native/etc/ssl/certs/ca-certificates.crt
CApath: none]
15:56:41 lr_yum_download_repomd: repomd.xml download was unsuccessful
Can some of you provide any useful advice to try to fix this?
Thank you in advance for your time! :-)
I finally fixed my issue removing completely my dnf bbappend recipe from my custom layer and adding this variable to my distro.conf file:
PACKAGE_FEED_URIS = "https://storage.googleapis.com/my_repo/"
After that, at the end of the build process the image contains a valid /etc/yum.d/oe-remote-repo file and all the necesary stuff to manage it. There is no need to copy "ca-certificates.crt" manually at all.
Also, it's important to execute this command after finishing the build of the image:
$ bitbake package-index
This command generates a "repodata" directory within the package feed needed by the target device once it uses the repo to update packages using dnf client.
I found a temporal hack to fix my issue:
$ cp /etc/ssl/certs/ca-certificates.crt /home/yocto/yocto/build/tmp/work/x86_64-linux/curl-native/7.54.1-r0/recipe-sysroot-native/etc/ssl/certs/
After that, I was finally able to build the image using the "https" repo.
Now I am in the process of fixing this issue in the right way. I'll come back with the final solution.

Minecraft 1.10.2 Forge Gradle error

So I'm trying to install the forge api (Minecraft 1.10.2) for developing a mod, and I'm having an issue with using ForgeGradle. Every time I run it with "bash gradlew setupDecompWorkspace", I get this error:
FAILURE: Build failed with an exception.
What went wrong:
Could not resolve all dependencies for configuration ':forgeGradleMcpData'.
Could not resolve de.oceanlabs.mcp:mcp:1.10.2.
Required by:
com.yourname.modid:forge-1:1.0
Could not resolve de.oceanlabs.mcp:mcp:1.10.2.
Could not get resource '(had to remove this link because too many links)'.
Could not GET '(had to remove this link because too many links)'.
org.apache.http.client.ClientProtocolException (no error message)
Could not resolve de.oceanlabs.mcp:mcp:1.10.2.
Could not get resource 'https://libraries.minecraft.net/de/oceanlabs/mcp/mcp/1.10.2/mcp-1.10.2.pom'.
Could not GET 'https://libraries.minecraft.net/de/oceanlabs/mcp/mcp/1.10.2/mcp-1.10.2.pom'. Received status code 403 from server: Forbidden
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
I've found several people with the same issue, but they were posted back in (roughly) Minecraft 1.6-1.8. Does anyone have any idea about what I should do? I'm stumped and could use some help.
You need to set the mappings property in the minecraft closure in your build.gradle file so ForgeGradle knows which version of the MCP mappings to use.
For example, this will use the latest mappings (as of this posting):
minecraft {
mappings = "snapshot_20161002"
}
The snapshot mappings are built daily and the versions are in the form of snapshot_YYYYMMDD, you can see all the mappings versions here.
I had a similar issue with forge for 1.11. I couldn't use the latest mappings file for some reason. Keeping the mappings file at snapshot_29160518 worked for me.
See this commit for a 1.10.2 plugin build.gradle file:
https://github.com/ljsimin/MinecraftJoypadSplitscreenMod/commit/76b7c83bc35cbe11d6516b31f8e5e4f7ec74b99c

Ionic build android failed with 403 Http respose from Gradle, JAVA_HOME not valid

I am using Windows 7X64 machine and trying to build Andriod application using cordova/ionic CLI v1.5.5. I am getting this error that I couldn't solve.
"You may not have the required environment or OS to build this project"
with commands ionic build android and cordova build android. The command ionic platform add android was successful. I am working with Android sdk (API 22) using the Android SDK Manager. I also made sure that PATH variable is correctly set.
Full transcript of process is:
C:\Users\ddevkota\Desktop\freshIonic>ionic build android
Running command: "C:\Program Files\nodejs\node.exe" C:\Users\ddevkota\Desktop\fr
eshIonic\hooks\after_prepare\010_add_platform_class.js C:\Users\ddevkota\Desktop
\freshIonic
add to body class: platform-android
Running command: cmd "/s /c "C:\Users\ddevkota\Desktop\freshIonic\platforms\andr
oid\cordova\build.bat""
ANDROID_HOME=C:\Users\ddevkota\AppData\Local\Android\sdk
JAVA_HOME=C:\Progra~1\Java\jdk1.7.0_15
Running: C:\Users\ddevkota\Desktop\freshIonic\platforms\android\gradlew cdvBuild
Debug -b C:\Users\ddevkota\Desktop\freshIonic\platforms\android\build.gradle -Do
rg.gradle.daemon=true
Downloading http://services.gradle.org/distributions/gradle-2.2.1-all.zip
Exception in thread "main" java.lang.RuntimeException: java.io.IOException: Serv
er returned HTTP response code: 403 for URL: http://services.gradle.org/distribu
tions/gradle-2.2.1-all.zip
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc
essManager.java:78)
at org.gradle.wrapper.Install.createDist(Install.java:47)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL:
http://services.gradle.org/distributions/gradle-2.2.1-all.zip
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
nection.java:1625)
at org.gradle.wrapper.Download.downloadInternal(Download.java:59)
at org.gradle.wrapper.Download.download(Download.java:45)
at org.gradle.wrapper.Install$1.call(Install.java:60)
at org.gradle.wrapper.Install$1.call(Install.java:47)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc
essManager.java:65)
... 3 more
C:\Users\ddevkota\Desktop\freshIonic\platforms\android\cordova\node_modules\q\q.
js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "C:\Users\ddevkota\Desktop\freshI
onic\platforms\android\gradlew cdvBuildDebug -b C:\Users\ddevkota\Desktop\freshI
onic\platforms\android\build.gradle -Dorg.gradle.daemon=true"
ERROR building one of the platforms: Error: cmd: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: cmd: Command failed with exit code 1
at ChildProcess.whenDone (C:\Users\ddevkota\AppData\Roaming\npm\node_modules
\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:134:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
Thanks for help in advance.
NOTE: This turns out to be a permission issue in client (403). I connected my machine to different network and it started working. All build process. If you wanna do it manually here is how far I got.
Solution for not Valid JAVA_HOME
After spending days and uninstalling all versions of java, reinstalling only one version and setting up Environment VariableJAVA_HOME as C:\Program Files\Java\jdk1.7.0_15 I solved the problem.
However there was another issue of ionic build android error when downloading gradle.
This was solved as I added gradle to my project offline.
Solution for not Gradle 403 Http response
Do the following:
After downloading gradle from issued link (here is https://services.gradle.org/distributions/gradle-2.2.1-all.zip) paste it in somewhere likes myApp\platforms\android\gradle\gradle-2.2.1-all.zip and in build.js from myApp\platforms\android\cordova\lib\build.js find this:
var distributionUrl = 'distributionUrl=https://services.gradle.org/distributions/gradle-2.2.1-all.zip';
And replace it with your own file's location:
var distributionUrl = 'distributionUrl=../gradle-2.2.1-all.zip';
Still working on build and will keep on posting the solution. A thread about other issues is created in ionic forum and it is here.
Solution for not Gradle 403 Http response
find distributionUrl variable in:
myapp\platforms\android\cordova\lib\builders\GradleBuilder.js
change http value to https in this line:
var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https://services.gradle.org/distributions/gradle-2.2.1-all.zip';

Sublime Text 3 - Package Control : "No packages available for installation" error when trying to install packages through secure channel

I am running Sublime on Ubuntu 14.04 LTS 64-bit. I have tried installing Package Installer on Sublime Text 3 using both the simple script and manual installation methods.
Whenever I try to run the Install Package option I get an error message "There are no packages available for installation"
The console shows the following trace:
Package Control: Error downloading channel. b'curl: (77) error setting certificate verify locations:\n CAfile: /usr/lib/ssl/certs/ca-certificates.crt\n CApath: /etc/ssl/certs' downloading https://sublime.wbond.net/channel.json.
error: Package Control
There are no packages available for installation
If I add http://sublime.wbond.net/repositories.json as a channel, install package starts showing the package list. But, when I try to install a package (e.g. Pretty JSON) I again get an error related to the security certificate with the following console trace:
reloading Packages/User/Preferences.sublime-settings
found 1 files for base name Default.sublime-theme
Package Control: Error downloading package. b'curl: (77) error setting certificate verify locations:\n CAfile: /usr/lib/ssl/certs/ca-certificates.crt\n CApath: /etc/ssl/certs' downloading https://codeload.github.com/dzhibas/SublimePrettyJson/zip/master.
error: Package Control
Unable to download Pretty JSON. Please view the console for more details.
theme loaded
ignored packages updated to: [Vintage]
found 1 files for base name Default.sublime-theme
theme loaded
reloading Packages/User/Preferences.sublime-settings
found 1 files for base name Default.sublime-theme
theme loaded
Any suggestions to get Package Control to work with the secure channel are welcome.
ADDITIONAL DEBUG TRACE FOR PACKAGE CONTROL:
Upon enabling debug for Package Control I get the following trace:
Package Control: Fetching list of available packages
Platform: linux-x64
Sublime Text Version: 3059
Package Control Version: 2.0.0
Package Control: Download Debug
URL: https://sublime.wbond.net/channel.json
Resolved IP: 50.116.34.243
Timeout: 30
Package Control: Found system CA bundle at /usr/lib/ssl/certs/ca-certificates.crt
Package Control: Curl Debug Proxy
http_proxy:
https_proxy:
proxy_username:
proxy_password:
Package Control: Trying to execute command /usr/bin/curl --user-agent 'Sublime Package Control v2.0.0' --connect-timeout 30 -sSL --compressed --dump-header /tmp/tmp_i20fq --cacert /usr/lib/ssl/certs/ca-certificates.crt -v https://sublime.wbond.net/channel.json
Package Control: Curl HTTP Debug General
Hostname was NOT found in DNS cache
Trying 50.116.34.243...
Connected to sublime.wbond.net (50.116.34.243) port 443 (#0)
error setting certificate verify locations:
CAfile: /usr/lib/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
Closing connection 0
CAfile: /usr/lib/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
Package Control: Error downloading channel. curl: (77) error setting certificate verify locations: downloading https://sublime.wbond.net/channel.json.
ignored packages updated to: [Vintage, Pretty JSON]
found 1 files for base name Default.sublime-theme
Package Control: Fetching list of available packages
Platform: linux-x64
Sublime Text Version: 3059
Package Control Version: 2.0.0
theme loaded
Package Control: Download Debug
URL: https://sublime.wbond.net/channel.json
Resolved IP: 50.116.34.243
Timeout: 30
Package Control: Found system CA bundle at /usr/lib/ssl/certs/ca-certificates.crt
Package Control: Curl Debug Proxy
http_proxy:
https_proxy:
proxy_username:
proxy_password:
Package Control: Trying to execute command /usr/bin/curl --user-agent 'Sublime Package Control v2.0.0' --connect-timeout 30 -sSL --compressed --dump-header /tmp/tmpcg0ent --cacert /usr/lib/ssl/certs/ca-certificates.crt -v https://sublime.wbond.net/channel.json
Package Control: Curl HTTP Debug General
Hostname was NOT found in DNS cache
Trying 50.116.34.243...
Connected to sublime.wbond.net (50.116.34.243) port 443 (#0)
error setting certificate verify locations:
CAfile: /usr/lib/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
Closing connection 0
CAfile: /usr/lib/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
Package Control: Error downloading channel. curl: (77) error setting certificate verify locations: downloading https://sublime.wbond.net/channel.json.
Package Control: Unable to find a sublime-package file for Pretty JSON
Package Control: Unable to find file package-metadata.json in the package Pretty JSON
Package Control: Download Debug
URL: https://codeload.github.com/dzhibas/SublimePrettyJson/zip/master
Resolved IP: 192.30.252.146
Timeout: 30
Package Control: Found system CA bundle at /usr/lib/ssl/certs/ca-certificates.crt
Package Control: Curl Debug Proxy
http_proxy:
https_proxy:
proxy_username:
proxy_password:
Package Control: Trying to execute command /usr/bin/curl --user-agent 'Sublime Package Control v2.0.0' --connect-timeout 30 -sSL --compressed --dump-header /tmp/tmpueshe5 --cacert /usr/lib/ssl/certs/ca-certificates.crt -v https://codeload.github.com/dzhibas/SublimePrettyJson/zip/master
reloading Packages/User/Preferences.sublime-settings
found 1 files for base name Default.sublime-theme
Package Control: Curl HTTP Debug General
Hostname was NOT found in DNS cache
Trying 192.30.252.147...
Connected to codeload.github.com (192.30.252.147) port 443 (#0)
error setting certificate verify locations:
CAfile: /usr/lib/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
Closing connection 0
CAfile: /usr/lib/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
Package Control: Error downloading package. curl: (77) error setting certificate verify locations: downloading https://codeload.github.com/dzhibas/SublimePrettyJson/zip/master.
error: Package Control
Unable to download Pretty JSON. Please view the console for more details.
Had the same issue today. Reinstalled package control:
Deleted Package Control folder inside the Sublime Text 3 > Packages folder
went to https://sublime.wbond.net/installation and executed the manual installation instructions there
...namely
Click the Preferences > Browse Packages… menu
Browse up a folder and then into the Installed Packages/ folder
Download Package Control.sublime-package and copy it into the Installed Packages/ directory
Restart Sublime Text
Worked like charm!
I had the same problem today in Ubuntu 16.04 LTS 64-bit with Sublime Text Build 3126.
Following advice from this Github issue page solved it for me.
Copy-paste the below lines to
Preferences > Package Settings > Package Control > Settings - User.
"channels":
[
"https://packagecontrol.io/channel_v3.json",
"https://web.archive.org/web/20150905194312/https://packagecontrol.io/channel_v3.json"
],
I had the same issue following an upgrade, but saw this in the readme and ran this python script which fixed it for me (ctrl + ' to bring up the console then ran the following command)
import urllib.request,os,sys; exec("if sys.version_info < (3,) or os.name != 'nt': raise OSError('This code is for Windows ST3 only!')"); pr='Preferences.sublime-settings'; ip='ignored_packages'; n='Package Control'; s=sublime.load_settings(pr); ig=s.get(ip); ig.append(n); s.set(ip,ig); sublime.save_settings('Preferences.sublime-settings'); pf=n+'.sublime-package'; urllib.request.install_opener(urllib.request.build_opener(urllib.request.ProxyHandler())); by=urllib.request.urlopen('https://packagecontrol.io/'+pf.replace(' ','%20')).read(); open(os.path.join(sublime.installed_packages_path(),pf),'wb').write(by); ig.remove(n); s.set(ip,ig); sublime.save_settings(pr); print('Package Control: 3.0.0 upgrade successful!')
I faced this issue yesterday and tried #Juri's answer but it didn't work because I couldn't download Package Control.sublime-package due to network error. Then, I tried to install a package today normally and it works. So, the problem is related to the server of package manager (https://packagecontrol.io/) and you should wait until the problem is fixed.
Check proxy setting in
Preferences > Package Settings > Package Control > Settings – Default / User
If the proxy setting is invalid, you would get this error too.
I had same issue. I was using Sublime Text 3 on MAC OS Catalina 10.15.6
Below change resolved issue like gem!
Go to
Preferences > Package Settings > Package Control > Settings – Default / User
And add below lines
"downloader_precedence":
{
"linux": [ "curl","wget","urllib"],
"osx": ["curl","wget","urllib"]
}
I was lately experiencing incidents related with SSL verification with curl, apt-get, wget, and in an attempt to install packages with Sublime :
SSL: CERTIFICATE_VERIFY_FAILED
Surfing on the net I find out that there's a package that manage the ca-certificates and that is :
mlazo#mlazo-pc:~$ dpkg -l |grep -i ca-certificates
ii ca-certificates 20201027ubuntu0.18.04.1 all Common CA certificates
So I proceed to reinstall it, with the following steps :
sudo apt-get install --reinstall ca-certificates
Once the main package is been re-installed, I proceed to install a package on Sublime with the keytrokes "Cntrl + Shift + P" getting a successfull outcome.
I really hope this information would be helpful for somebody else.
Best regards,
Manuel Lazo
Try again now. I think the web admin fixed the certificate problem -- you may need to delete the package control file and install it again (but you can keep settings and other packages already installed).
Also, seems to fail if you don't have cURL installed, but you do.
Install the package using the manual method (follow these steps):
Click the Preferences > Browse Packages… menu
Browse up a folder and then into the Installed Packages/ folder
Download Package Control.sublime-package and copy it into the Installed Packages/ directory
Restart Sublime Text
Then don't forget to add your proxy and port to the file Preferences > Package Settings > Package Control > Settings - User like so:
"http_proxy": "[proxy]:[port]"
The project maintainer is having a problem with the package control server at the time of writing this.
See https://forum.sublimetext.com/t/package-control-outage/41274/31 for more information on the restoration progress or if you wish to offer support.
Meanwhile, in order to access packages you wish to install, you can search google for the package name and use the cached google page to find the package's project page.
For example, you could search "sublime text 3 predawn" and go to the packages project page (in this case github) to download and install it manually.
Navigate to the project page from the cached package control page. The project page will give you access to the package as well as manual install procedures.
Working Answer is here:
[FIX] Sublime Error - There Are Not Packages Available For Installation - 100% working
https://mrmoeed.blogspot.com/2019/09/fix-sublime-error-there-are-not.html
Had same issue, console was showing 403 error at https://packagecontrol.io/channel_v3.json.
I had to download the file manually and change the channel to the file in my computer. Not sure if that's most reliable way, as you probably would need to download the file again to see most recent packages, but it's the only thing that worked for me.
So just download the file from: https://packagecontrol.io/channel_v3.json
Add the file to your channel in:
prefernces > package settings > package control > settings - user.
Like this:
"channels":
[
"C:\\Users\\YourUser\\Downloads\\channel_v3.json"
],
For Mac Users :: Solution Here what you need to do.
Open System Preference -> Network -> Advanced -> Proxies
then remove everything from the proxies Text area.
uncheck Use FTP mode.
thats's it.
Quit Sublime, restart again and hit CMD+Shift+P

Resources