diff --git a/public/app/features/plugins/sql/components/configuration/TLSSecretsConfig.tsx b/public/app/features/plugins/sql/components/configuration/TLSSecretsConfig.tsx index 6414924d683..d602c802d1b 100644 --- a/public/app/features/plugins/sql/components/configuration/TLSSecretsConfig.tsx +++ b/public/app/features/plugins/sql/components/configuration/TLSSecretsConfig.tsx @@ -12,31 +12,36 @@ import { InlineField, SecretTextArea } from '@grafana/ui'; export interface Props { editorProps: DataSourcePluginOptionsEditorProps; showCACert?: boolean; + showKeyPair?: boolean; secureJsonFields?: KeyValue; labelWidth?: number; } export const TLSSecretsConfig = (props: Props) => { - const { labelWidth, editorProps, showCACert } = props; + const { labelWidth, editorProps, showCACert, showKeyPair = true } = props; const { secureJsonFields } = editorProps.options; return ( <> - To authenticate with an TLS/SSL client certificate, provide the client certificate here.} - labelWidth={labelWidth} - label="TLS/SSL Client Certificate" - > - { - updateDatasourcePluginResetOption(editorProps, 'tlsClientCert'); - }} - > - + {showKeyPair ? ( + To authenticate with an TLS/SSL client certificate, provide the client certificate here. + } + labelWidth={labelWidth} + label="TLS/SSL Client Certificate" + > + { + updateDatasourcePluginResetOption(editorProps, 'tlsClientCert'); + }} + > + + ) : null} {showCACert ? ( If the selected TLS/SSL mode requires a server root certificate, provide it here.} @@ -55,23 +60,24 @@ export const TLSSecretsConfig = ) : null} - - To authenticate with a client TLS/SSL certificate, provide the key here.} - labelWidth={labelWidth} - label="TLS/SSL Client Key" - > - { - updateDatasourcePluginResetOption(editorProps, 'tlsClientKey'); - }} - > - + {showKeyPair ? ( + To authenticate with a client TLS/SSL certificate, provide the key here.} + labelWidth={labelWidth} + label="TLS/SSL Client Key" + > + { + updateDatasourcePluginResetOption(editorProps, 'tlsClientKey'); + }} + > + + ) : null} ); }; diff --git a/public/app/plugins/datasource/mysql/configuration/ConfigurationEditor.tsx b/public/app/plugins/datasource/mysql/configuration/ConfigurationEditor.tsx index f8616870fd1..b3266990760 100644 --- a/public/app/plugins/datasource/mysql/configuration/ConfigurationEditor.tsx +++ b/public/app/plugins/datasource/mysql/configuration/ConfigurationEditor.tsx @@ -128,10 +128,11 @@ export const ConfigurationEditor = (props: DataSourcePluginOptionsEditorProps - {options.jsonData.tlsAuth ? ( + {jsonData.tlsAuth || jsonData.tlsAuthWithCACert ? (