Skip to content

Commit

Permalink
update for hierynomus/sshj#879
Browse files Browse the repository at this point in the history
  • Loading branch information
snesm committed Sep 7, 2023
1 parent 68de388 commit 014296e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions prime-router/src/main/kotlin/transport/RESTTransport.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 014296e

Please sign in to comment.