Small knowledge, big challenge! This article is participating in the creation activity of “Essential Tips for Programmers”.

directory

  • The problem
  • To solve

The problem

An X509 error was reported when the file was uploaded.

2021-10-15 17:46:13.145 ERROR oss/upload. Go :210 upload process Failed {” ERROR “: “Post” https://192.168.215.139:9443/store/file/upload\ “: x509: Cannot validate certificate for 192.168.215.139 because it doesn’t contain any IP SANs”}

panic: send on closed channel

To solve

I also found many other methods on the Internet, which seemed very correct, but actually did not solve the problem I encountered, so I found a solution.

First of all, the analysis of the general cause of the problem is the problem of the authentication mechanism.

I recall that I also encountered an X509 error before, but the specific error is not the same, so I wonder whether they belong to a class of errors? Anyway also do not have what good method, that dead horse regard as live horse cure!

The command is as follows:

sudo apt-get update

Output result:

root@al-bj-backstage-01:~# sudo apt-get update Hit:1 http://mirrors.cloud.aliyuncs.com/ubuntu bionic InRelease Get:2 http://mirrors.cloud.aliyuncs.com/ubuntu bionic - updates InRelease [88.7 kB] Get: 3 http://mirrors.cloud.aliyuncs.com/ubuntu bionic - backports InRelease [74.6 kB] Get: 4 http://mirrors.cloud.aliyuncs.com/ubuntu bionic ws-security InRelease [88.7 kB] Get: 5 http://mirrors.cloud.aliyuncs.com/ubuntu bionic-updates/main Sources [517 kB] Get:6 http://mirrors.cloud.aliyuncs.com/ubuntu bionic-updates/main i386 Packages [1360 kB] Get:7 http://mirrors.cloud.aliyuncs.com/ubuntu bionic-updates/main amd64 Packages [2251 kB] Get:8 http://mirrors.cloud.aliyuncs.com/ubuntu bionic-security/main Sources [258 kB] Get:9 http://mirrors.cloud.aliyuncs.com/ubuntu bionic-security/main amd64 Packages [1906 kB] Get:10 http://mirrors.cloud.aliyuncs.com/ubuntu bionic-security/main i386 Packages [1055 kB] Fetched 7600 kB in 2s (4971 kB/s) Reading package lists... DoneCopy the code

Step 2:

sudo apt-get install ca-certificates -y

Output result:

root@al-bj-backstage-01:~# sudo apt-get install ca-certificates -y Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be upgraded: ca-certificates 1 upgraded, 0 newly installed, 0 to remove and 59 not upgraded. Need to get 145 kB of archives. After this operation, 2048 B disk space will be freed. The Get: 1 http://mirrors.cloud.aliyuncs.com/ubuntu bionic - updates/main amd64 Ca-certificates All 20210119~18.04.2 [145 kB] Preconfiguring Packages in 0S (1,866 kB/s) (Reading database ... 117632 files and directories currently installed.) Preparing to unpack ... / ca - certificates_20210119 ~ 18.04.2 _all. Deb... Unpacking ca-certificates (20210119~18.04.2) over (20210119~18.04.1)... Setting up ca-certificates (20210119~18.04.2)... Updating certificates in /etc/ssl/certs... 0 added, 1 removed; Done. Processing Triggers for man-DB (2.8.3-2Ubuntu0.1)... Processing Triggers for CA-certificates (20210119~18.04.2)... Updating certificates in /etc/ssl/certs... 0 added, 0 removed; done. Running hooks in /etc/ca-certificates/update.d... done.Copy the code

Restart upload service, call upload interface again, error disappeared, problem solved, great!