diff --git a/src/services/domains-services/v4/create-domain-service.js b/src/services/domains-services/v4/create-domain-service.js index 6dc6cf66a..42fdd43dd 100644 --- a/src/services/domains-services/v4/create-domain-service.js +++ b/src/services/domains-services/v4/create-domain-service.js @@ -59,10 +59,11 @@ const adapt = (payload) => { dataRequest.tls.certificate = payload.edgeCertificate } if (payload.supportedCiphers && payload.useHttps) { - dataRequest.tls.ciphers = payload.supportedCiphers === 'all' ? null : payload.supportedCiphers + dataRequest.tls.ciphers = payload.supportedCiphers === 'null' ? null : payload.supportedCiphers } if (payload.minimumTlsVersion && payload.useHttps) { - dataRequest.tls.minimum_version = payload.minimumTlsVersion + dataRequest.tls.minimum_version = + payload.minimumTlsVersion === 'null' ? null : payload.minimumTlsVersion } return dataRequest diff --git a/src/services/domains-services/v4/edit-domain-service.js b/src/services/domains-services/v4/edit-domain-service.js index ab780f9f5..d2cec5c5c 100644 --- a/src/services/domains-services/v4/edit-domain-service.js +++ b/src/services/domains-services/v4/edit-domain-service.js @@ -34,7 +34,8 @@ const adapt = (payload) => { alternate_domains: payload.cnames.split('\n').filter((item) => item !== ''), active: payload.active, tls: { - minimum_version: null + minimum_version: null, + ciphers: null }, protocols: { http: { @@ -60,10 +61,11 @@ const adapt = (payload) => { dataRequest.tls.certificate = payload.edgeCertificate } if (payload.supportedCiphers && payload.useHttps) { - dataRequest.tls.ciphers = payload.supportedCiphers === 'all' ? null : payload.supportedCiphers + dataRequest.tls.ciphers = payload.supportedCiphers === 'null' ? null : payload.supportedCiphers } if (payload.minimumTlsVersion && payload.useHttps) { - dataRequest.tls.minimum_version = payload.minimumTlsVersion + dataRequest.tls.minimum_version = + payload.minimumTlsVersion === 'null' ? null : payload.minimumTlsVersion } return dataRequest diff --git a/src/services/domains-services/v4/load-domain-service.js b/src/services/domains-services/v4/load-domain-service.js index 0e7e01e59..b030e387a 100644 --- a/src/services/domains-services/v4/load-domain-service.js +++ b/src/services/domains-services/v4/load-domain-service.js @@ -69,8 +69,8 @@ const adapt = (httpResponse) => { httpsPort: handlerHttp(body.protocols.http.https_ports, HTTPS_PORT_LIST_OPTIONS), quicPort: handlerHttp(body.protocols.http.quic_ports, HTTP3_PORT_LIST_OPTIONS), httpPort: handlerHttp(body.protocols.http.http_ports, HTTP_PORT_LIST_OPTIONS), - supportedCiphers: body.tls.ciphers, - minimumTlsVersion: body.tls.minimum_version + supportedCiphers: String(body.tls.ciphers), + minimumTlsVersion: String(body.tls.minimum_version) } return { diff --git a/src/tests/services/domains-services/v4/edit-domain-service.test.js b/src/tests/services/domains-services/v4/edit-domain-service.test.js index 5160fe083..4d624c280 100644 --- a/src/tests/services/domains-services/v4/edit-domain-service.test.js +++ b/src/tests/services/domains-services/v4/edit-domain-service.test.js @@ -172,7 +172,8 @@ describe('DomainsServicesV4', () => { active: fixtures.domainMock.active, tls: { certificate: fixtures.domainMock.edgeCertificate, - minimum_version: null + minimum_version: null, + ciphers: null }, protocols: { http: { diff --git a/src/views/Domains/FormFields/FormFieldsCreateDomains.vue b/src/views/Domains/FormFields/FormFieldsCreateDomains.vue index d1638c66a..542b6c834 100644 --- a/src/views/Domains/FormFields/FormFieldsCreateDomains.vue +++ b/src/views/Domains/FormFields/FormFieldsCreateDomains.vue @@ -97,14 +97,14 @@ { name: '8090', value: 8090 } ] const TLS_VERSIONS_OPTIONS = [ - { label: 'None', value: 'none' }, + { label: 'None', value: 'null' }, { label: 'TLS 1.0', value: 'tls_1_0' }, { label: 'TLS 1.1', value: 'tls_1_1' }, { label: 'TLS 1.2', value: 'tls_1_2' }, { label: 'TLS 1.3', value: 'tls_1_3' } ] const SUPPORTED_CIPHERS_LIST_OPTIONS = [ - { label: 'All', value: 'all' }, + { label: 'All', value: 'null' }, { label: 'TLSv1.2_2018', value: 'TLSv1.2_2018' }, { label: 'TLSv1.2_2019', value: 'TLSv1.2_2019' }, { label: 'TLSv1.2_2021', value: 'TLSv1.2_2021' }, diff --git a/src/views/Domains/FormFields/FormFieldsEditDomains.vue b/src/views/Domains/FormFields/FormFieldsEditDomains.vue index cdf4405e3..f26a1e062 100644 --- a/src/views/Domains/FormFields/FormFieldsEditDomains.vue +++ b/src/views/Domains/FormFields/FormFieldsEditDomains.vue @@ -80,14 +80,14 @@ { name: '8090', value: 8090 } ] const TLS_VERSIONS_OPTIONS = [ - { label: 'None', value: 'none' }, + { label: 'None', value: 'null' }, { label: 'TLS 1.0', value: 'tls_1_0' }, { label: 'TLS 1.1', value: 'tls_1_1' }, { label: 'TLS 1.2', value: 'tls_1_2' }, { label: 'TLS 1.3', value: 'tls_1_3' } ] const SUPPORTED_CIPHERS_LIST_OPTIONS = [ - { label: 'All', value: 'all' }, + { label: 'All', value: 'null' }, { label: 'TLSv1.2_2018', value: 'TLSv1.2_2018' }, { label: 'TLSv1.2_2019', value: 'TLSv1.2_2019' }, { label: 'TLSv1.2_2021', value: 'TLSv1.2_2021' }, @@ -155,6 +155,12 @@ } }) + watch(useHttps, (newValue) => { + if (newValue && !httpsPort.value) { + httpsPort.value = [HTTPS_PORT_LIST_OPTIONS[0]] + } + }) + const digitalCertificateDrawerRef = ref('') const openDigitalCertificateDrawer = () => { digitalCertificateDrawerRef.value.openCreateDrawer()