Remove certificate workaround

This commit is contained in:
Inix 2025-10-21 22:13:48 +02:00
parent 10d724b669
commit d2ba755052
3 changed files with 0 additions and 61 deletions

View file

@ -200,11 +200,6 @@ object NativeLibrary {
external fun logSettings()
/**
* Sets the path to CA certificates for SSL/TLS verification.
*/
external fun setCACertificatePath(path: String)
/**
* Checks for available updates.
*/

View file

@ -64,55 +64,9 @@ class YuzuApplication : Application() {
PowerStateUpdater.start()
Log.logDeviceInfo()
// Initialize CA certificates for HTTPS
if (NativeLibrary.isUpdateCheckerEnabled()) {
initializeCACertificates()
}
createNotificationChannels()
}
// required for httplib and update checker
private fun initializeCACertificates() {
try {
val trustManagerFactory = TrustManagerFactory.getInstance(
TrustManagerFactory.getDefaultAlgorithm()
)
trustManagerFactory.init(null as KeyStore?)
val trustManagers = trustManagerFactory.trustManagers
if (trustManagers.isEmpty()) {
Log.error("[SSL] No trust managers found")
return
}
val x509TrustManager = trustManagers[0] as X509TrustManager
val acceptedIssuers = x509TrustManager.acceptedIssuers
if (acceptedIssuers.isEmpty()) {
Log.error("[SSL] No CA certificates found")
return
}
val certFile = File(filesDir, "cacert.pem")
FileOutputStream(certFile).use { outputStream ->
for (cert in acceptedIssuers) {
outputStream.write("-----BEGIN CERTIFICATE-----\n".toByteArray())
val encoded = android.util.Base64.encodeToString(
cert.encoded,
android.util.Base64.DEFAULT
)
outputStream.write(encoded.toByteArray())
outputStream.write("-----END CERTIFICATE-----\n".toByteArray())
}
}
NativeLibrary.setCACertificatePath(certFile.absolutePath)
Log.info("[SSL] Initialized ${acceptedIssuers.size} CA certificates at: ${certFile.absolutePath}")
} catch (e: Exception) {
Log.error("[SSL] Failed to initialize CA certificates: ${e.message}")
}
}
companion object {
var documentsTree: DocumentsTree? = null
lateinit var application: YuzuApplication

View file

@ -91,8 +91,6 @@ std::atomic<bool> g_has_battery = {true};
// playtime
std::unique_ptr<PlayTime::PlayTimeManager> play_time_manager;
// SSL Certificate path for HTTPS requests
std::string g_ca_cert_path;
EmulationSession::EmulationSession() {
m_vfs = std::make_shared<FileSys::RealVfsFilesystem>();
@ -1125,14 +1123,6 @@ JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_isUpdateChecker
}
#ifdef ENABLE_UPDATE_CHECKER
JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_setCACertificatePath(
JNIEnv* env,
jobject obj,
jstring path) {
const char* path_str = env->GetStringUTFChars(path, nullptr);
g_ca_cert_path = std::string(path_str);
env->ReleaseStringUTFChars(path, path_str);
}
JNIEXPORT jstring JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_checkForUpdate(
JNIEnv* env,