readme.sslinfo
来自「PostgreSQL 8.2中增加了很多企业用户所需要的功能和性能上的提高,其开」· SSLINFO 代码 · 共 121 行
SSLINFO
121 行
sslinfo - information about current SSL certificate for PostgreSQL==================================================================Author: Victor Wagner <vitus@cryptocom.ru>, Cryptocom LTDE-Mail of Cryptocom OpenSSL development group: <openssl@cryptocom.ru>1. Notes--------This extension won't build unless your PostgreSQL server is configuredwith --with-openssl. Information provided with these functions wouldbe completely useless if you don't use SSL to connect to database.2. Functions Description------------------------2.1. ssl_is_used()~~~~~~~~~~~~~~~~~~ ssl_is_used() RETURNS boolean;Returns TRUE, if current connection to server uses SSL and FALSEotherwise.2.2. ssl_client_cert_present()~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ssl_client_cert_present() RETURNS booleanReturns TRUE if current client have presented valid SSL clientcertificate to the server and FALSE otherwise (e.g., no SSL,certificate hadn't be requested by server).2.3. ssl_client_serial() ~~~~~~~~~~~~~~~~~~~~~~~~ ssl_client_serial() RETURNS numericReturns serial number of current client certificate. The combinationof certificate serial number and certificate issuer is guaranteed touniquely identify certificate (but not its owner -- the owner ought toregularily change his keys, and get new certificates from the issuer).So, if you run you own CA and allow only certificates from this CA tobe accepted by server, the serial number is the most reliable (albeitnot very mnemonic) means to indentify user.2.4. ssl_client_dn()~~~~~~~~~~~~~~~~~~~~ ssl_client_dn() RETURNS textReturns the full subject of current client certificate, convertingcharacter data into the current database encoding. It is assumed thatif you use non-Latin characters in the certificate names, yourdatabase is able to represent these characters, too. If your databaseuses the SQL_ASCII encoding, non-Latin characters in the name will berepresented as UTF-8 sequences.The result looks like '/CN=Somebody /C=Some country/O=Some organization'.2.5. ssl_issuer_dn()~~~~~~~~~~~~~~~~~~~~Returns the full issuer name of the client certificate, convertingcharacter data into current database encoding.The combination of the return value of this function with thecertificate serial number uniquely identifies the certificate.The result of this function is really useful only if you have morethan one trusted CA certificate in your server's root.crt file, or ifthis CA has issued some intermediate certificate authoritycertificates.2.6. ssl_client_dn_field()~~~~~~~~~~~~~~~~~~~~~~~~~~ ssl_client_dn_field(fieldName text) RETURNS textThis function returns the value of the specified field in thecertificate subject. Field names are string constants that areconverted into ASN1 object identificators using the OpenSSL objectdatabase. The following values are acceptable: commonName (alias CN) surname (alias SN) name givenName (alias GN) countryName (alias C) localityName (alias L) stateOrProvinceName (alias ST) organizationName (alias O) organizationUnitName (alias OU) title description initials postalCode streetAddress generationQualifier description dnQualifier x500UniqueIdentifier pseudonim role emailAddress All of these fields are optional, except commonName. It dependsentirely on your CA policy which of them would be included and whichwouldn't. The meaning of these fields, howeer, is strictly defined bythe X.500 and X.509 standards, so you cannot just assign arbitrarymeaning to them.2.7 ssl_issuer_field()~~~~~~~~~~~~~~~~~~~ ssl_issuer_field(fieldName text) RETURNS text;Does same as ssl_client_dn_field, but for the certificate issuerrather than the certificate subject.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?