andrzejchm / RESTMock

HTTP Server for Android Instrumentation tests
https://medium.com/@andrzejchm/ittd-instrumentation-ttd-for-android-4894cbb82d37#.uir3loxu7
Apache License 2.0
756 stars 58 forks source link

Crash with proguard #113

Open bmesing opened 4 years ago

bmesing commented 4 years ago

Hi, the REST-Mock crashes when proguard obfuscation is applied and HTTPS is enabled. Here is the stacktrace: 2020-05-08 14:19:07.799 13382-13475/xxx E/AndroidRuntime: FATAL EXCEPTION: pool-10-thread-1 Process: xxx, PID: 13382 java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.String java.security.PublicKey.getAlgorithm()' on a null object reference at java.security.KeyStore$PrivateKeyEntry.(KeyStore.java:576) at java.security.KeyStore$PrivateKeyEntry.(KeyStore.java:526) at java.security.KeyStoreSpi.engineGetEntry(KeyStoreSpi.java:485) at java.security.KeyStore.getEntry(KeyStore.java:1560) at com.android.org.conscrypt.KeyManagerImpl.(KeyManagerImpl.java:72) at com.android.org.conscrypt.KeyManagerFactoryImpl.engineGetKeyManagers(KeyManagerFactoryImpl.java:115) at javax.net.ssl.KeyManagerFactory.getKeyManagers(KeyManagerFactory.java:305)

According to this article the reason may be, that a deprecated version of spongycastle code to generate a self signed certificate is used: http://quabr.com:8182/59848764/how-to-fix-proguard-removes-java-security-code

Regards Benjamin

andrzejchm commented 4 years ago

thanks @bmesing for reporting this, I'll take a look into it