Python
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
ca_certificate = client.cdn.trusted_ca_certificates.replace(
id=0,
name="Example CA cert 2",
)
print(ca_certificate.id)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/cdn"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
caCertificate, err := client.CDN.TrustedCaCertificates.Replace(
context.TODO(),
0,
cdn.TrustedCaCertificateReplaceParams{
Name: "Example CA cert 2",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", caCertificate.ID)
}
curl --request PUT \
--url https://api.gcore.com/cdn/sslCertificates/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Example CA cert 2"
}
'const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Example CA cert 2'})
};
fetch('https://api.gcore.com/cdn/sslCertificates/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/cdn/sslCertificates/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Example CA cert 2'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.put("https://api.gcore.com/cdn/sslCertificates/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Example CA cert 2\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cdn/sslCertificates/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Example CA cert 2\"\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"name": "Example CA certificate",
"deleted": false,
"cert_issuer": "Example CA",
"cert_subject_cn": "Example CA",
"cert_subject_alt": null,
"validity_not_before": "2026-01-01T00:00:00Z",
"validity_not_after": "2036-01-01T00:00:00Z",
"sslCertificateChain": "",
"hasRelatedResources": false
}CA certificates
Change trusted CA certificate
PUT
/
cdn
/
sslCertificates
/
{id}
Python
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
ca_certificate = client.cdn.trusted_ca_certificates.replace(
id=0,
name="Example CA cert 2",
)
print(ca_certificate.id)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/cdn"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
caCertificate, err := client.CDN.TrustedCaCertificates.Replace(
context.TODO(),
0,
cdn.TrustedCaCertificateReplaceParams{
Name: "Example CA cert 2",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", caCertificate.ID)
}
curl --request PUT \
--url https://api.gcore.com/cdn/sslCertificates/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Example CA cert 2"
}
'const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Example CA cert 2'})
};
fetch('https://api.gcore.com/cdn/sslCertificates/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/cdn/sslCertificates/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Example CA cert 2'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.put("https://api.gcore.com/cdn/sslCertificates/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Example CA cert 2\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cdn/sslCertificates/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Example CA cert 2\"\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"name": "Example CA certificate",
"deleted": false,
"cert_issuer": "Example CA",
"cert_subject_cn": "Example CA",
"cert_subject_alt": null,
"validity_not_before": "2026-01-01T00:00:00Z",
"validity_not_after": "2036-01-01T00:00:00Z",
"sslCertificateChain": "",
"hasRelatedResources": false
}Authorizations
Body
application/json
Response
200 - application/json
Successful.
Was this page helpful?