我正在尝试使用 Java 和 SSL 连接到 Oracle DB。现在我在带有数据库的服务器上有 Java 程序。
当我尝试运行它时出现此错误(评论中的完整错误):
java.sql.SQLRecoverableException: IO Error: Inbound closed before receiving peer's close_notify: possible truncation attack?, connect lapse 15 ms., Authentication lapse 0 ms.
Run Code Online (Sandbox Code Playgroud)
这是我的Java代码:
public static void main(String[] args) {
Security.addProvider(new oracle.security.pki.OraclePKIProvider());
String url = "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=localhost)(PORT=2484))(CONNECT_DATA=(SERVICE_NAME=ORCL)))";
Properties props = new Properties();
props.setProperty("javax.net.ssl.trustStore",
"C:\\app\\Administrator\\virtual\\product\\12.2.0\\dbhome_1\\bin\\wallets\\Administrator\\cwallet.sso");
props.setProperty("javax.net.ssl.trustStoreType","SSO");
props.setProperty("javax.net.ssl.keyStore",
"C:\\app\\Administrator\\virtual\\product\\12.2.0\\dbhome_1\\bin\\wallets\\Administrator\\cwallet.sso");
props.setProperty("javax.net.ssl.keyStoreType","SSO");
try {
Connection conn = DriverManager.getConnection(url, props);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Run Code Online (Sandbox Code Playgroud)
我将此添加到 listener.ora 和 tnsnames.ora (我也尝试使用 sso …
我有一个脚本,可以完美地使用 Windows PowerShell 上传到 S3 存储桶,但它不适用于 PowerShell Core。根据 Amazon 的说法,大多数适用于其中一个的 cmdlet 也应该适用于另一个。
这是我正在使用的命令:
Write-S3Object -BucketName $bucketName -Folder $localDir -KeyPrefix $targetFolder -AccessKey $accessKey -SecretKey $secretKey -Recurse
Run Code Online (Sandbox Code Playgroud)
同样,当我尝试直接运行 PowerShell 命令时,它按预期工作,但在 PowerShell Core 中我收到此错误:
Write-S3Object : The term 'Write-S3Object' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Write-S3Object -BucketName "cloud-storage-poc" -Folder …Run Code Online (Sandbox Code Playgroud)