Article directory
foreword
When I was developing a small thing a few days ago, I encountered a problem: the SpringBoot interface was suddenly inaccessible , and I also wrote a blog, [The road to Java into the pit] The project in Spring Boot compiles normally, but the RestController interface suddenly fails. no access
As a result, I encountered this problem again today! Besides, there is basically no problem with my code. I can't request it when I use postman locally. Later, I can't solve it with my own method (including restarting the computer). I directly requested the GET interface with the browser and found that I could request it. The original Not my interface problem!
Later, by querying the information, it was found that it was a problem with the ssl certificate.
text
When using postman request, I found a detail, which was ignored last time!
I think the general meaning is that you need to use chrome to import the SSL certificate. The way to see the Internet is to open the postman settings certificate file
(picture from https://blog.csdn.net/fangkang7/article/details/84338498)
But the postman on my side is In this way, there are so many options (covering my face) that
I hurried to the official website to re-download a postman, the download link https://www.getpostman.com/downloads/
Temporary setup request
Before setting up postman, we can temporarily allow postman to access https
to open chrome, and then enter the local https address, such as https://localhost/hello , it will prompt us that this is an insecure link, click the red box location to use postman Request, but there is a drawback, when chrome is closed, postman will not be able to request, then we can use another method.
Import the certificate into postman
Open the real postman , in the settings SETTING, close the SSL certificate verification below,
open the Certificates in the SETTING, click Add Certificates and
fill in the file directory of the certificate in the following format. There are many ways to obtain the certificate. I also wrote one before. The tutorial for obtaining the Alibaba Cloud server certificate, click here to apply for the Alibaba Cloud server SSL certificate
and click Add to
test the interface.
Successfully returned to hello to
test the https interface written by yourself, OK, no problem!
Summarize
Hahahaha, I always thought it was a problem with my own network or other aspects, but I didn't expect that it was because the SSL certificate was not imported
but it was ok before. As for the reason why the request suddenly appeared ineffective, I am not sure. If there is If you know about it, you can leave a comment below.
Oh right, I just finished running, I really like the feeling of climbing uphill, although it is very tired and difficult to run, but when you finish running uphill, you will have another experience, an achievement of conquering the uphill feel!
mutual encouragement!