fix: use sslmode=preferred for pg and mysql

all hosted vendors require SSL and the existing ssl=none won’t work.
This commit is contained in:
Tianzhou Chen
2023-05-21 17:28:13 +08:00
parent ad31e18ea2
commit f2aefa8e95
3 changed files with 27 additions and 19 deletions

View File

@ -18,14 +18,14 @@ interface Props {
close: () => void;
}
type SSLType = "none" | "ca-only" | "full";
type SSLType = "preferred" | "ca-only" | "full";
type SSLFieldType = "ca" | "cert" | "key";
const SSLTypeOptions = [
{
label: "None",
value: "none",
label: "Preferred",
value: "preferred",
},
{
label: "CA Only",
@ -76,7 +76,7 @@ const CreateConnectionModal = (props: Props) => {
const connectionStore = useConnectionStore();
const [connection, setConnection] = useState<Connection>(defaultConnection);
const [showDeleteConnectionModal, setShowDeleteConnectionModal] = useState(false);
const [sslType, setSSLType] = useState<SSLType>("none");
const [sslType, setSSLType] = useState<SSLType>("preferred");
const [selectedSSLField, setSelectedSSLField] = useState<SSLFieldType>("ca");
const [isRequesting, setIsRequesting] = useState(false);
const showDatabaseField = connection.engineType === Engine.PostgreSQL;
@ -310,7 +310,7 @@ const CreateConnectionModal = (props: Props) => {
</label>
))}
</div>
{sslType !== "none" && (
{sslType !== "preferred" && (
<>
<div className="text-sm space-x-3 mb-2">
<span