Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 0b8eac76

Přidáno uživatelem Jan Pašek před téměř 4 roky(ů)

Re #8706 - Specify custom extensions

Zobrazit rozdíly:

static/js/create_certificate.js
7 7
        isSelfSigned: false,
8 8
        invalidCN: false,
9 9
        customKey: false,
10
        customExtensions: false,
10 11
        // available certificate authorities
11 12
        authorities: [],
12 13
        // data of the selected certificate authorities to be displayed in the form
......
39 40
            },
40 41
            CA: null
41 42
        },
43
        extensions: null,
42 44
        key: {
43 45
            password: null,
44 46
            key_pem: null,
......
103 105
            }
104 106

  
105 107
            // populate optional key field in the request body
106
            if (this.key.password != null && this.key.password !== "") {
108
            delete this.certificateData.key;
109
            if (this.customKey && this.key.password != null && this.key.password !== "") {
107 110
                this.certificateData.key.password = this.key.password;
108 111
            }
109
            if (this.key.key_pem != null) {
112
            if (this.customKey && this.key.key_pem != null) {
110 113
                this.certificateData.key.key_pem = this.key.key_pem;
111 114
            }
112 115

  
116
            // populate optional extensions field in the request body
117
            delete this.certificateData.extensions;
118
            if (this.customExtensions && this.extensions !== "" && this.extensions != null)
119
            {
120
                this.certificateData.extensions = this.extensions;
121
            }
122

  
123

  
113 124
            this.certificateData.validityDays = parseInt(this.certificateData.validityDays);
114 125
            try {
115 126
                const response = await axios.post(API_URL + "certificates", this.certificateData);

Také k dispozici: Unified diff