我是OracleDB的新手。我正在研究在不提供用户名和密码的情况下将客户端应用程序连接到服务器上的Oracle DB。我的理解是正确的,这可以通过使用orapki
钱包来实现吗?我用我的笔记本电脑作为客户端和服务器来测试这一点。
我使用orapki
为客户端和服务器端创建钱包,如下所示:
Create Server Wallet :
orapki wallet create -wallet "C:/app/wallet" -pwd Welcome1 -auto_login
orapki wallet add -wallet "C:/app/wallet" -pwd Welcome1 -dn "CN=MyHostName" -keysize 1024 -self_signed -validity 3650 -sign_alg sha256
orapki wallet export -wallet "C:/app/wallet" -pwd Welcome1 -dn "CN=MyHostName" -cert C:/app/wallet/MyHostName-certificate.crt
Create Client Wallet: [I choose CN name to match username for oracleDB login name, i.e., abcd]
orapki wallet create -wallet "C:/app/client_wallet" -pwd Welcome1 -auto_login
orapki wallet add -wallet "C:/app/client_wallet" -pwd Welcome1 -dn "CN=abcd" -keysize 1024 -self_signed -validity 3650 -sign_alg sha256
orapki wallet export -wallet "C:/app/client_wallet" -pwd Welcome1 -dn "CN=abcd" -cert C:/app/client_wallet/abcd-certificate.crt
将证书从一侧装入另一侧的钱包。
Load the server certificate into the client wallet.
orapki wallet add -wallet "C:/app/client_wallet" -pwd Welcome1 -trusted_cert -cert C:/app/wallet/MyHostName-certificate.crt
Load the Client certificate into the server wallet.
orapki wallet add -wallet "C:/app/wallet" -pwd Welcome1 -trusted_cert -cert C:/app/client_wallet/abcd-certificate.crt
显示钱包会得到以下结果:
Server Wallet:
orapki wallet display -wallet "C:/app/wallet" -pwd Welcome1
Oracle PKI Tool : Version 12.1.0.2
Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
Requested Certificates:
User Certificates:
Subject: CN=MyHostName
Trusted Certificates:
Subject: CN=abcd
Subject: CN=MyHostName
Client Wallet:
orapki wallet display -wallet "C:/app/client_wallet" -pwd Welcome1
Oracle PKI Tool : Version 12.1.0.2
Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
Requested Certificates:
User Certificates:
Subject: CN=abcd
Trusted Certificates:
Subject: CN=MyHostName
Subject: CN=abcd
我从上面了解到,服务器和客户端现在相互信任,因此有利于建立连接。
服务器设置文件如下所示:
tnsnames.ora
TCP_ACTIVE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = MyHostName)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
TCPS_ACTIVE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCPS)(HOST = MyHostName)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
听众。奥拉
SSL_CLIENT_AUTHENTICATION = TRUE
WALLET_LOCATION =
(SOURCE =
(METHOD = FILE)
(METHOD_DATA =
(DIRECTORY = C:\app\wallet)
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\app\MyUser\product\12.1.0\dbhome_2)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\app\MyUser\product\12.1.0\dbhome_2\bin\oraclr12.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = MyHostName)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCPS)(HOST = MyHostName)(PORT = 1522))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
sqlnet。奥拉
SQLNET.AUTHENTICATION_SERVICES= (BEQ, TCPS, NTS)
SQLNET.WALLET_OVERRIDE = FALSE
#SSL_VERSION = 0
TRACE_LEVEL_CLIENT = SUPPORT
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
SSL_CLIENT_AUTHENTICATION = TRUE
WALLET_LOCATION =
(SOURCE =
(METHOD = FILE)
(METHOD_DATA =
(DIRECTORY = C:\app\wallet)
)
)
#SSL_CIPHER_SUITES= (SSL_RSA_WITH_AES_256_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA)
我有一个简单的c测试客户端使用OCCI设置文件如下所示
tnsnames.ora
TCP_ACTIVE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = MyHostName)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
TCPS_ACTIVE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCPS)(HOST = MyHostName)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
sqlnet。奥拉
TRACE_LEVEL_CLIENT=support
WALLET_LOCATION =
(SOURCE =
(METHOD = FILE)
(METHOD_DATA =
(DIRECTORY = C:\app\client_wallet)
)
)
SSL_CLIENT_AUTHENTICATION =TRUE
SSL_SERVER_DN_MATCH=OFF
TRACE_LEVEL_CLIENT = 16
TRACE_FILE_CLIENT = client_trace
TRACE_TIMESTAMP_CLIENT = ON
TRACE_DIRECTORY_CLIENT = C:\Client
DIAG_ADR_ENABLED=ON
我的服务器监听器服务状态如下所示:
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHostName)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 64-bit Windows: Version 12.1.0.2.0 - Production
Start Date 24-OCT-2019 19:46:17
Uptime 0 days 21 hr. 31 min. 25 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File C:\app\MyUser\product\12.1.0\dbhome_2\network\admin\listener.ora
Listener Log File C:\app\MyUser\diag\tnslsnr\MyHostName\listener\alert\log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=MyHostName)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=MyHostName)(PORT=1522)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=MyHostName)(PORT=5500))(Security=(my_wallet_directory=C:\app\wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "orcl" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
当我尝试使用连接字符串“TCP_ACTIVE”连接到服务器并提供用户名和密码时,我能够正常连接
Environment *env = Environment::createEnvironment();
Connection *conn = env->createConnection(m_username.c_str(), m_password.c_str(), m_dbConnectionString.c_str());
“conn”中的连接似乎已经形成,并且能够使用它成功地运行简单的查询。
但当我试图使用TCPS_活动连接字符串连接到服务器时,我只能在提供用户名和密码时连接。以下是我没有提供用户名和密码时收到的错误消息:
ORA-01017: invalid username/password; logon denied
我很好奇,是否可以使用钱包连接到服务器,而不使用用户名和密码?如果是这样,我应该如何设置它进行测试?
非常感谢。
注:我也研究过类似的问题,但我不明白设置是如何完成的。
似乎我的用户需要在外部标识为“CN=abcd”才能正常工作。使用管理员登录转到SQL Developer并运行:
alter user abcd identified externally as 'CN=abcd';
以上代码无需密码即可连接。
我收到一个错误“无法建立SSL连接,请参阅内部异常。身份验证失败,请参阅内部异常。”当尝试通过C#HttpWebRequest通过SSL发布请求时(已尝试RestSharp和HttpClient,结果相同)。我还尝试了网络上提到的所有可能的解决方案,如: 他们都不为我工作。另一个问题是,我在另一台计算机上运行相同的项目,它的工作没有任何问题。所以看起来问题的来源是环境,也许. net框架或注册表中
问题内容: 我试图连接到http://bluesql.net上的mySQL数据库,但是当我尝试连接时,出现此错误: 我已经研究过了,它与MySQL 4.1之前使用的一些旧密码方案有关。较新的版本可以选择使用旧密码,我已阅读过此密码可能会导致此问题。 我正在运行php 5.3,并与mySQLi(新的mysqli(…))连接。我希望我可以在代码中做一些事情以连接到bluesql.net上的数据库- 显
我正在尝试为相互身份验证设置ActiveMQ,以便客户端需要证书才能将消息传递给代理。我在代理上创建了一个密钥库和一个信任库,并导出了一个复制到客户端的证书。在客户端,我也做了同样的事情,尽管我使用的是NMS,所以我只使用导出的证书,我将其添加到代理的信任库中。我还将证书添加到另一个本地计算机可信根证书中。 代理的配置如下: ${activemq.base}/conf/login.config $
我试图设置2方式ssl身份验证。我的要求是经纪人应该只认证特定的客户。 我的组织有一个CA,它发行pkcs12格式的所有证书。我遵循的步骤如下。 获取代理的证书,并在代理密钥库中配置它 当我运行代理和客户端时,我希望代理验证客户端并建立ssl连接。但是下面的错误被抛出。 当我用只包含CA证书的信任存储文件替换 /etc/pki/java/cacerts代理信任存储时,它工作得很好。但是它将验证任何
问题内容: 如何使用node.js连接到mongodb? 我有node-mongodb-native驱动程序。 显然有0个文档。 是这样吗? 用户名和密码放在哪里? 另外,我该如何插入? 谢谢。 问题答案: 根据来源: 连接后: