From 014296ed9bc539fe1413b42e79964067f7b1e182 Mon Sep 17 00:00:00 2001 From: Stephen Nesman <94193373+snesm@users.noreply.github.com> Date: Thu, 7 Sep 2023 13:43:39 -0400 Subject: [PATCH] update for https://github.com/hierynomus/sshj/pull/879 --- prime-router/src/main/kotlin/transport/RESTTransport.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/prime-router/src/main/kotlin/transport/RESTTransport.kt b/prime-router/src/main/kotlin/transport/RESTTransport.kt index fc066c64142..9622ccf7604 100644 --- a/prime-router/src/main/kotlin/transport/RESTTransport.kt +++ b/prime-router/src/main/kotlin/transport/RESTTransport.kt @@ -54,10 +54,10 @@ import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking import kotlinx.serialization.decodeFromString import kotlinx.serialization.json.Json -import net.schmizz.sshj.common.Base64 import org.json.JSONObject import java.io.InputStream import java.security.KeyStore +import java.util.Base64 import java.util.logging.Logger import javax.net.ssl.KeyManagerFactory import javax.net.ssl.SSLContext @@ -406,7 +406,7 @@ class RESTTransport(private val httpClient: HttpClient? = null) : ITransport { if (restUrl.contains("dataingestion.datateam-cdc-nbs")) { val idTokenInfoString: String = client.post(restUrl) { val credentialString = credential.user + ":" + credential.pass - val basicAuth = "Basic " + Base64.encodeBytes(credentialString.encodeToByteArray()) + val basicAuth = "Basic " + Base64.getEncoder().encodeToString(credentialString.encodeToByteArray()) expectSuccess = true // throw an exception if not successful postHeaders( mapOf( @@ -550,7 +550,7 @@ class RESTTransport(private val httpClient: HttpClient? = null) : ITransport { */ private fun getSslContext(jksCredential: UserJksCredential): SSLContext? { // Open the keystore in the UserJksCredential, it's a PKCS12 type - val jksDecoded = Base64.decode(jksCredential.jks) + val jksDecoded = Base64.getDecoder().decode(jksCredential.jks) val inStream: InputStream = jksDecoded.inputStream() val jksPasscode = jksCredential.jksPasscode.toCharArray() val keyStore: KeyStore = KeyStore.getInstance("PKCS12")