How to Obtain and Configure an SSL Certificate for Mini Program Deployment
This guide details the step‑by‑step process of obtaining a free SSL certificate, exporting it, and configuring the server with the appropriate key‑store settings to enable HTTPS for a mini‑program, including tips on common pitfalls and verification methods.
Preparing to launch an interview project as a mini‑program requires HTTPS; this article records the complete process and pitfalls.
Step 1: Apply for an SSL Certificate
The author chose a free service at https://freessl.cn/ , but any provider can be used according to needs.
The chosen method is offline generation, which requires domain verification. Alibaba Cloud users can use one‑click generation with an authorization code, but this is not recommended because AsianTrust does not support mini‑programs and only works on a computer.
PS: You need to install a client software required by the provider; following its prompts will automatically verify the domain.
If verification stalls, switch to “One‑click apply” and select “I am not an Alibaba Cloud user”; the verification will change from web‑based to software‑based and can be completed instantly.
Step 2: Export the Certificate
Export methods differ per platform; the author shows their own approach.
1. Export the certificate using the website tool
The tool automatically downloads a ZIP package.
Open the IIS folder (not Tomcat); currently most SSL providers, including Alibaba Cloud, only issue PFX certificates, and using JKS may cause trouble after expiration.
Step 3: Configuration Code
server:
port: 443
ssl:
key-store: classpath:aaaaa.pfx
key-store-password: yourpassword
keyStoreType: PKCS12The password is the one set during the certificate export (step five); any matching password works.
The filename just needs to correspond to the configuration; there are no strict naming requirements.
Java Captain
Focused on Java technologies: SSM, the Spring ecosystem, microservices, MySQL, MyCat, clustering, distributed systems, middleware, Linux, networking, multithreading; occasionally covers DevOps tools like Jenkins, Nexus, Docker, ELK; shares practical tech insights and is dedicated to full‑stack Java development.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.