Adding a self-signed certificate to iphone Simulator?

后端 未结 7 672
轮回少年
轮回少年 2020-11-28 19:42

I have a self-signed certificate at the endpoint of my API. I\'m trying to test some things using the simulator but am getting \"untrusted server certificate\".

I h

7条回答
  •  生来不讨喜
    2020-11-28 20:28

    Using iPhone Backup Extractor, I copied my iPhone's TrustStore.sqlite3 into ~/Library/Application Support/iPhone Simulator/6.0/Library/Keychains, overwriting the existing file. I tried to only insert a single row with the following sqlite, but I couldn't get it working.

    sqlite3 ~/backup/iOS\ Files/TrustStore.sqlite3
    sqlite3>.mode insert
    sqlite3>.output working.sql
    sqlite3>select * from tsettings;
    sqlite3>.quit
    

    Now, working.sql has the entire contents of the tsettings table (in my case, 1 row).

    sqlite3 ~/Library/Application\ Support/iPhone\ Simulator/6.0/Library/Keychains/TrustStore.sqlite3
    sqlite3>INSERT INTO tsettings VALUES(X'...
    sqlite3>.quit
    

    Again, the above sqlite commands didn't work for me, but might be a good starting point for someone else. Copying the entire TrustStore.sqlite3 from the backup into the simulator worked just fine.

提交回复
热议问题