> ## Documentation Index
> Fetch the complete documentation index at: https://gcore.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Change SSL certificate



## OpenAPI

````yaml /api-reference/services_documented/cdn_api.yaml put /cdn/sslData/{ssl_id}
openapi: 3.1.0
info:
  title: Gcore OpenAPI – CDN API
  description: >-
    This OpenAPI is an aggregated OpenAPI specification that unifies all Gcore
    products into a single file. It covers Cloud, CDN, DNS, WAAP, DDoS
    Protection, Object Storage, Streaming, and FastEdge services.
  version: '2026-05-15T06:37:28.230198+00:00'
servers:
  - url: https://api.gcore.com
security:
  - APIKey: []
tags:
  - name: CDN service
    description: Information about the current state of the CDN service in your account.
    x-displayName: CDN service
  - name: CDN resources
    x-displayName: CDN resources
  - name: Origins
    x-displayName: Origins
  - name: Rules
    description: >-
      Rules allow to set up custom settings for certain file types or paths.

      By default, the rule inherits all options values from the related CDN
      resource.


      Each option in rule settings can be in one of the following states:

      - **Inherit** - Option is not added to the rule. Option inherits its value
      from the CDN resource settings. In this case, the option value is
      **null**.

      - **ON** - Option is added to the rule and enabled. Option values
      configured in the rule will override values from the CDN resource
      settings.

      - **OFF** - Option is added to the rule and disabled. Option will be
      turned off.
    x-displayName: Rules
  - name: Rule templates
    x-displayName: Rule templates
  - name: SSL certificates
    x-displayName: SSL certificates
  - name: Let's Encrypt certificates
    x-displayName: Let's Encrypt certificates
  - name: CA certificates
    x-displayName: CA certificates
  - name: CDN activity logs
    description: |-
      Get the history of users requests to CDN.
      It contains requests made both via the API and via the control panel.

      The following methods are not tracked in the activity logs:
      - HEAD
      - OPTIONS
    x-displayName: CDN activity logs
  - name: Log viewer
    description: >-
      Log viewer provides you with general information about CDN operation. This
      information does not contain all possible

      sets of fields and restricted by time. To receive full data, use Logs
      Uploader.
    x-displayName: Log viewer
  - name: Logs uploader
    description: >-
      Logs uploader allows you to upload logs with desired format to desired
      storages.


      Consists of three main parts:

      - **Policies** - rules that define which logs are uploaded and how they
      are uploaded.

      - **Targets** - destinations where logs are uploaded.

      - **Configs** - combinations of logs uploader policies, targets and
      resources to which they are applied.
    x-displayName: Logs uploader
  - name: Tools
    x-displayName: Tools
  - name: CDN Statistics
    description: >-
      Consumption statistics is updated in near real-time as a standard
      practice.

      However, the frequency of updates can vary, but they are typically
      available within a 24-hour period.

      Exceptions, such as maintenance periods, may delay data beyond 24 hours
      until servers resume and fill in the missing statistics.
    x-displayName: Statistics
  - name: Advanced analytics
    description: >-
      Advanced analytics allows to get statistics about unique visitors,
      traffic, and requests for countries, directories, browsers, devices, and
      operation systems for up to 90 days starting from today.


      Advanced analytics API is based on the [GraphQL
      framework](https://graphql.org/).


      Advanced analytics API has one single endpoint:

       https://api.gcore.com/cdn/advanced/v2/query

      You can pass the query parameters as a JSON object in the payload of a
      POST request to this endpoint.

      You can use curl to make requests to the Advanced analytics API.
      Alternatively, you can use a GraphQL client

      to construct queries and pass requests to the Advanced analytics API.


      You can write queries in GraphQL much like in SQL: specify the data set
      (CDN resource), the metrics

      to retrieve (such as unique visitors and traffic), and filter or group by
      dimensions (for example, a country).
    x-displayName: Advanced analytics
  - name: Origin shielding
    x-displayName: Origin shielding
  - name: IP addresses list
    x-displayName: IP addresses list
  - name: Purge history
    x-displayName: Purge history
paths:
  /cdn/sslData/{ssl_id}:
    put:
      tags:
        - SSL certificates
      summary: Change SSL certificate
      operationId: change-ssl-certificate
      parameters:
        - in: path
          name: ssl_id
          description: SSL certificate ID.
          required: true
          schema:
            type: integer
          x-stainless-terraform-configurability: computed
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSSlPayload'
      responses:
        '200':
          description: Successful.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSSLAnswer'
      x-codeSamples:
        - lang: Python
          source: |-
            import os
            from gcore import Gcore

            client = Gcore(
                api_key=os.environ.get("GCORE_API_KEY"),  # This is the default and can be omitted
            )
            ssl_detail = client.cdn.certificates.replace(
                ssl_id=0,
                name="New certificate",
                ssl_certificate="-----BEGIN CERTIFICATE-----\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QEAnNMM8FrlLke3cl03g7NoYzDq1zUmGSXhvb418XCSL7e4S0EF\nq6meNQhY7LEqxGiHC6PjdeTm86dicbp5gWAf15Gan/PQeGdxyGkOlZHP/uaZ6WA8\nSMx+yk13EiSdRxta67nsHjcAHJyse6cF6s5K671B5TaYucv9bTyWaN8jKkKQDIZ0\nKOqkqm57TH2H3eDJAkSnh6/DNFu0Qg==\n-----END CERTIFICATE-----\n",
                ssl_private_key="-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDZcNCZiNNHfX2O\ndZpf12mv2rAZwqGZBAdpox0wntEPK3JciQ7ZRloLJeHuCNIJs9MidnH7Xk8zveju\nmab6HmfIzvMJAAm88OYWMFQRiYe1ggJEHMe7yYPQbtXwTqWDYdWmjPPma3Ujqqmb\nhmVX2rsYILD7cUjS+e0Ucfqx3QODQj/aujTt1rS0gFhJ0soY5m+C6VimPCx4Bjyw\n5rhtskJDRrfXxrIhVXOvSPFRyxDSfjt3win8vjhhZ3oFPWgrl9lVhn0zaB5hjDsd\n-----END PRIVATE KEY-----\n",
            )
            print(ssl_detail.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/G-Core/gcore-go\"\n\t\"github.com/G-Core/gcore-go/cdn\"\n\t\"github.com/G-Core/gcore-go/option\"\n)\n\nfunc main() {\n\tclient := gcore.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tsslDetail, err := client.CDN.Certificates.Replace(\n\t\tcontext.TODO(),\n\t\t0,\n\t\tcdn.CertificateReplaceParams{\n\t\t\tName:           \"New certificate\",\n\t\t\tSslCertificate: \"-----BEGIN CERTIFICATE-----\\nMIIFWzCCBEOgAwIBAgISBK6qoNitg//89H/YJamujpWlMA0GCSqGSIb3DQEBCwUA\\nMEoxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MSMwIQYDVQQ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Z6WA8\\nSMx+yk13EiSdRxta67nsHjcAHJyse6cF6s5K671B5TaYucv9bTyWaN8jKkKQDIZ0\\nKOqkqm57TH2H3eDJAkSnh6/DNFu0Qg==\\n-----END CERTIFICATE-----\\n\",\n\t\t\tSslPrivateKey:  \"-----BEGIN PRIVATE KEY-----\\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDZcNCZiNNHfX2O\\ndZpf12mv2rAZwqGZBAdpox0wntEPK3JciQ7ZRloLJeHuCNIJs9MidnH7Xk8zveju\\nmab6HmfIzvMJAAm88OYWMFQRiYe1ggJEHMe7yYPQbtXwTqWDYdWmjPPma3Ujqqmb\\nhmVX2rsYILD7cUjS+e0Ucfqx3QODQj/aujTt1rS0gFhJ0soY5m+C6VimPCx4Bjyw\\n5rhtskJDRrfXxrIhVXOvSPFRyxDSfjt3win8vjhhZ3oFPWgrl9lVhn0zaB5hjDsd\\n-----END PRIVATE KEY-----\\n\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", sslDetail.ID)\n}\n"
components:
  schemas:
    CreateSSlPayload:
      title: Own Certificate
      properties:
        name:
          type: string
          description: |-
            SSL certificate name.

            It must be unique.
          example: New certificate
        sslCertificate:
          type: string
          description: |-
            Public part of the SSL certificate.

            All chain of the SSL certificate should be added.
          example: |
            -----BEGIN CERTIFICATE-----
            MIIFWzCCBEOgAwIBAgISBK6qoNitg//89H/YJamujpWlMA0GCSqGSIb3DQEBCwUA
            MEoxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MSMwIQYDVQQD
            ExpMZXQncyBFbmNyeXB0IEF1dGhvcml0eSBYMzAeFw0xODExMTMxMjQwMDJaFw0x
            OTAyMTExMjQwMDJaMBwxGjAYBgNVBAMTEWNkbjIudG50LWNsdWIuY29tMIIBIjAN
            BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzaHExDEXNSf6ELS0WUR7qq8gs9cc
            xx99sM2zs3Jld0twPmuldkVNe5xte/Hj03r4SesfOBczR7pn+t60YujPvUQDN8lx
            WYpvRuetOneyf4gNPatwzR/W1GWGlahet1xPVYGrttqL4gCJeShIXvU4aCyzW941
            Pt0wCs+bg9u+59fXFkigWrWJPkwbR7bJ14XTStYynMbYLfCg+VPeGWj3d8wOhQcf
            AD86o8TLTbVfK2BDXwS5S8Dgf5u8g+WvmVHYDIkYKCxcLj0jP61Y7uHoFbSg41oN
            A9yPOa+0cYxA7U702V2WjxbfIeATYtNLZvH17lk+DYlQl8q3MLwguqZdgwIDAQAB
            iIqI2xquGONtHFDOKJvy1O2qYTVRtNRVZqhc1ol+mw==
            -----END CERTIFICATE-----
            -----BEGIN CERTIFICATE-----
            MIIEkjCCA3qgAwIBAgIQCgFBQgAAAVOFc2oLheynCDANBgkqhkiG9w0BAQsFADA/
            MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT
            DkRTVCBSb290IENBIFgzMB4XDTE2MDMxNzE2NDA0NloXDTIxMDMxNzE2NDA0Nlow
            SjELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUxldCdzIEVuY3J5cHQxIzAhBgNVBAMT
            GkxldCdzIEVuY3J5cHQgQXV0aG9yaXR5IFgzMIIBIjANBgkqhkiG9w0BAQEFAAOC
            AQ8AMIIBCgKCAQEAnNMM8FrlLke3cl03g7NoYzDq1zUmGSXhvb418XCSL7e4S0EF
            q6meNQhY7LEqxGiHC6PjdeTm86dicbp5gWAf15Gan/PQeGdxyGkOlZHP/uaZ6WA8
            SMx+yk13EiSdRxta67nsHjcAHJyse6cF6s5K671B5TaYucv9bTyWaN8jKkKQDIZ0
            KOqkqm57TH2H3eDJAkSnh6/DNFu0Qg==
            -----END CERTIFICATE-----
        sslPrivateKey:
          type: string
          description: Private key of the SSL certificate.
          example: |
            -----BEGIN PRIVATE KEY-----
            MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDZcNCZiNNHfX2O
            dZpf12mv2rAZwqGZBAdpox0wntEPK3JciQ7ZRloLJeHuCNIJs9MidnH7Xk8zveju
            mab6HmfIzvMJAAm88OYWMFQRiYe1ggJEHMe7yYPQbtXwTqWDYdWmjPPma3Ujqqmb
            hmVX2rsYILD7cUjS+e0Ucfqx3QODQj/aujTt1rS0gFhJ0soY5m+C6VimPCx4Bjyw
            5rhtskJDRrfXxrIhVXOvSPFRyxDSfjt3win8vjhhZ3oFPWgrl9lVhn0zaB5hjDsd
            -----END PRIVATE KEY-----
        validate_root_ca:
          type: boolean
          description: >-
            Defines whether to check the SSL certificate for a signature from a
            trusted certificate authority.


            Possible values:


            - **true** - SSL certificate must be verified to be signed by a
            trusted certificate authority.

            - **false** - SSL certificate will not be verified to be signed by a
            trusted certificate authority.
          example: true
      required:
        - name
        - sslCertificate
        - sslPrivateKey
    GetSSLAnswer:
      type: object
      properties:
        id:
          type: integer
          description: SSL certificate ID.
          example: 42
        deleted:
          type: boolean
          description: >-
            Defines whether the certificate has been deleted. Parameter is
            **deprecated**.


            Possible values:

            - **true** - Certificate has been deleted.

            - **false** - Certificate has not been deleted.
          example: false
        cert_issuer:
          type: string
          description: Name of the certification center issued the SSL certificate.
          example: Some certification center
        cert_subject_cn:
          type: string
          description: Domain name that the SSL certificate secures.
          example: mydomain.name
        cert_subject_alt:
          type: string
          description: Alternative domain names that the SSL certificate secures.
        validity_not_before:
          type: string
          description: Date when certificate become valid (ISO 8601/RFC 3339 format, UTC.)
          example: '2016-09-17T18:06:01Z'
        validity_not_after:
          type: string
          description: >-
            Date when certificate become untrusted (ISO 8601/RFC 3339 format,
            UTC.)
          example: '2017-08-21T11:02:00Z'
        sslCertificateChain:
          type: string
          description: Parameter is **deprecated**.
        hasRelatedResources:
          type: boolean
          description: |-
            Defines whether the SSL certificate is used by a CDN resource.

            Possible values:
            - **true** - Certificate is used by a CDN resource.
            - **false** - Certificate is not used by a CDN resource.
          example: true
        name:
          type: string
          description: SSL certificate name.
          example: Some certificate
        automated:
          type: boolean
          description: |-
            How the SSL certificate was issued.

            Possible values:
            - **true** - Certificate was issued automatically.
            - **false** - Certificate was added by a use.
          example: false
  securitySchemes:
    APIKey:
      description: >-
        API key for authentication. Make sure to include the word `apikey`,
        followed by a single space and then your token.

        Example: `apikey 1234$abcdef`
      type: apiKey
      in: header
      name: Authorization

````