Upload your own certificate
If you've bought or been issued a certificate from another authority, you can upload it to the Certificate Center and use it for CDN domains and bound bucket domains. Your own certificates don't renew automatically, so replace them manually before they expire.
Entry point: Certificate Center › Certificate management › Upload custom certificate (证书中心 › 证书管理 › 上传自定义证书) (open).
Upload
- Click Upload custom certificate.
- Fill in the fields in the table below and click Save (保存).
- When the dot in the list changes from yellow (deploying) to green (deployed), you can use it.
| Field | Rule |
|---|---|
| Certificate name (证书名称) | 1 to 36 characters, starting with a letter, containing only letters, digits, and - _ . *. It can't duplicate an existing certificate. |
| Certificate content (证书内容) | PEM format. Paste the complete certificate chain: the server certificate first, followed by the intermediate certificates. The root certificate is usually not needed. File extensions are usually .pem, .crt, .cer. |
| Private key content (私钥内容) | PEM format, and it must match the certificate. It can contain only one private key, with nothing else before or after, and no password protection. File extensions are usually .pem, .key. |
What the certificate content looks like:
-----BEGIN CERTIFICATE-----
(server certificate)
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
(intermediate certificate)
-----END CERTIFICATE-----The private key can start with -----BEGIN PRIVATE KEY-----, -----BEGIN RSA PRIVATE KEY-----, or -----BEGIN EC PRIVATE KEY-----.
Self-check before uploading
# View the domains and validity period in the certificate
openssl x509 -in fullchain.pem -noout -ext subjectAltName -dates
# Check that the certificate matches the private key: both lines should be identical
openssl x509 -in fullchain.pem -noout -pubkey | openssl sha256
openssl pkey -in private.key -pubout | openssl sha256
# Count the certificates in the chain (usually 2 or more)
grep -c "BEGIN CERTIFICATE" fullchain.pemCommon format conversions:
# PFX / P12 to PEM
openssl pkcs12 -in cert.pfx -nokeys -out fullchain.pem
openssl pkcs12 -in cert.pfx -nocerts -nodes -out private.key
# DER to PEM
openssl x509 -inform der -in cert.cer -out cert.pem
# Remove the private key password
openssl pkey -in encrypted.key -out private.keyFiles exported from a PFX may include descriptive text such as Bag Attributes. In the private key file, keep only the part from BEGIN to END.
Messages when saving
| Message | What to do |
|---|---|
| "证书内容无效或不是PEM格式" (the certificate content is invalid or not PEM) | Confirm you pasted PEM text that includes both the BEGIN CERTIFICATE and END CERTIFICATE lines. |
| "证书与私钥不匹配或私钥格式错误" (the certificate and private key don't match, or the private key format is wrong) | Check with the commands above. The server certificate must come first, and the private key must have no password and no extra content. |
| "存在同名证书,请更换证书名" (a certificate with the same name exists, change the name) | Use a different name, or Modify (修改) the existing certificate in the list. |
| "参数不合法" (invalid parameter) | The name, certificate content, and private key content must all be filled in. |
Replace a certificate
Before a certificate expires, replace its contents with the new certificate. Don't create a new one, so the CDN domains using it don't need to be changed one by one.
- Find the certificate in the list and click Modify.
- Paste the new Certificate content and Private key content, and keep the name the same. For security, the window doesn't show the existing content.
- Click Save and wait for the dot to turn green again.
Where it takes effect:
| Where it's used | After replacement |
|---|---|
| CDN domains | Switch to the new certificate automatically. Nothing to do. |
| Bound bucket domains | Not replaced automatically. Go to the bucket domain's HTTPS configuration (HTTPS 配置), select this certificate again, and save. See Deploy certificates. |
| Servers that fetch through the API | Get the new content the next time they fetch. |
The new certificate must still cover every domain that uses it, or HTTPS on those domains errors out. If a replacement fails, the list status goes back to deployed and the old certificate stays in use, so check whether the Expiration time has been updated.
You can't modify a certificate while it's deploying. You see "证书正在部署中,请稍后再操作" (the certificate is being deployed, try again later). You can't modify auto certificates, and you don't need to replace them manually.
Upload with the API
The Certificate API supports uploading a new certificate, which suits calling from your own issuance process:
jq -n --arg name "my-domain-cert" \
--rawfile crt fullchain.pem --rawfile key private.key \
'{cert_name: $name, cert_content: $crt, cert_private_key: $key}' |
curl -X POST "https://api.bitiful.com/cert/add" \
-H "Authorization: <API Token>" \
-H "Content-Type: application/json" \
--data-binary @-The endpoint can only add, and the name can't duplicate an existing certificate. To replace an existing certificate, do it in the console.
FAQ
Is a server certificate alone, without intermediate certificates, enough?
You can upload it, but some clients (especially Android and command-line tools) report errors because the intermediate certificates are missing. Download the complete certificate chain from the certificate authority.
Can I use a self-signed certificate?
Not recommended. Visitors' browsers don't trust self-signed certificates. You can use a free auto certificate instead.
What if I don't want to replace certificates manually?
Use an auto certificate. After you request it, switch your CDN domains to it.