Support verify-ca and verify-full as sslmode values, new in 8.4
authormha <mha@a7884b65-44f6-0310-8a51-81a127f17b15>
Fri, 24 Apr 2009 12:38:54 +0000 (12:38 +0000)
committermha <mha@a7884b65-44f6-0310-8a51-81a127f17b15>
Fri, 24 Apr 2009 12:38:54 +0000 (12:38 +0000)
git-svn-id: svn://svn.pgadmin.org/trunk/pgadmin3@7821 a7884b65-44f6-0310-8a51-81a127f17b15

pgadmin/db/pgConn.cpp
pgadmin/debugger/dbgPgConn.cpp
pgadmin/dlg/dlgServer.cpp
pgadmin/pgAdmin3.cpp
pgadmin/schema/pgServer.cpp

index 206af3e2f2ab818fe54ee47373ebc7b78dc48a6a..3ef364f38eec4b5ec031c8fa0e02ee68a27cb41e 100644 (file)
@@ -150,6 +150,8 @@ pgConn::pgConn(const wxString& server, const wxString& database, const wxString&
             case 2: connstr.Append(wxT(" sslmode=prefer"));    break;
             case 3: connstr.Append(wxT(" sslmode=allow"));     break;
             case 4: connstr.Append(wxT(" sslmode=disable"));   break;
+                       case 5: connstr.Append(wxT(" sslmode=verify-ca")); break;
+                       case 6: connstr.Append(wxT(" sslmode=verify-full"));break;
         }
     }
     else
@@ -268,6 +270,10 @@ wxString pgConn::GetSslModeName()
             return wxT("allow");     
         case 4: 
             return wxT("disable");   
+               case 5:
+                       return wxT("verify-ca");
+               case 6:
+                       return wxT("verify-full");
         default: 
             return wxT("prefer");   
     }
@@ -479,6 +485,11 @@ void pgConn::ExamineLibpqVersion()
                 if (libpqVersion < 7.4)
                     libpqVersion=7.4;
             }
+                       if (!strcmp(co->keyword, "sslrootcert"))
+                       {
+                               if (libpqVersion < 8.4)
+                                       libpqVersion=8.4;
+                       }
             co++;
         }
         PQconninfoFree(cio);
index eefa44b1cfebf872e0b98f697390152aec05268c..d777e31fa6cc932fe5394f303e6f939b6c41da5f 100644 (file)
@@ -189,6 +189,14 @@ void dbgPgConn::Init( const wxString &server, const wxString &database, const wx
             connectParams.Append(wxT(" sslmode=disable"));
             break;
 
+               case 5:
+                       connectParams.Append(wxT(" sslmode=verify-ca"));
+                       break;
+
+               case 6:
+                       connectParams.Append(wxT(" sslmode=verify-full"));
+                       break;
+
         default:
             break;
     }
index 2e8b3bf09e0471a037cf24541da05f122aa908ee..7a740b47c1640109bc24468e0b3d95b87e92c530 100644 (file)
@@ -235,6 +235,12 @@ int dlgServer::Go(bool modal)
         cbSSL->Append(_("allow"));
         cbSSL->Append(_("disable"));
     }
+
+       if (pgConn::GetLibpqVersion() >= 8.4)
+       {
+               cbSSL->Append(_("verify-ca"));
+               cbSSL->Append(_("verify-full"));
+       }
 #endif
 
     if (server)
index 48667b46f059c27a6d66c8f69209321cec79725f..ae4b0119a441d5fbc3b490add1828fe62b359df2 100644 (file)
@@ -479,6 +479,10 @@ bool pgAdmin3::OnInit()
                             sslmode = 3;
                         else if (!tmps.Cmp(wxT("disable")))
                             sslmode = 4;
+                                               else if (!tmps.Cmp(wxT("verify-ca")))
+                                                       sslmode = 5;
+                                               else if (!tmps.Cmp(wxT("verify-full")))
+                                                       sslmode = 6;
                         else
                         {
                             wxMessageBox(_("Unknown SSL mode: ") + tmps);
@@ -565,6 +569,10 @@ bool pgAdmin3::OnInit()
                             sslmode = 3;
                         else if (!tmps.Cmp(wxT("disable")))
                             sslmode = 4;
+                                               else if (!tmps.Cmp(wxT("verify-ca")))
+                                                       sslmode = 5;
+                                               else if (!tmps.Cmp(wxT("verify-full")))
+                                                       sslmode = 6;
                         else
                         {
                             wxMessageBox(_("Unknown SSL mode: ") + tmps);
index 943e9035ff4457559960ec849b9d357cffd018f3..f6bea48c717864e6b12c773451065da000e53f45 100644 (file)
@@ -930,6 +930,8 @@ void pgServer::ShowTreeDetail(ctlTree *browser, frmMain *form, ctlListView *prop
                         case 2: sslMode = _("prefer"); break;
                         case 3: sslMode = _("allow"); break;
                         case 4: sslMode = _("disable"); break;
+                                               case 5: sslMode = _("verify-ca"); break;
+                                               case 6: sslMode = _("verify-full"); break;
                     }
                     properties->AppendItem(_("SSL Mode"), sslMode);
                 }