Adding a self-signed certificate to iphone Simulator?

后端 未结 7 674
轮回少年
轮回少年 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:39

    I had this same issue for months and today I FINALLY solved it with:

    ADVTrustStore

    You are going to want to use a project called ADVTrustStore from github. It does some fancy magic but it will correctly install certificates into your root trust-store on the simulator.

    Steps to install a custom cert

    # Clone the repo
    git clone https://github.com/ADVTOOLS/ADVTrustStore.git
    
    # Enter the repo directory
    cd ADVTrustStore/
    
    # Copy your .crt file 
    cp somewhere/something.crt my.crt
    
    # conver to a .pem file
    openssl x509 -in my.crt -out my.pem -outform PEM
    
    # Install the pem in the simulators
    ./iosCertTrustManager.py -a my.pem
    

    Using this process I was able to get GoogleStreetView images to render correctly while behind a corporate firewall using SSL resigning with self-signed certificates

    Background

    I was using CharlesProxy and i noticed it was correctly installing certificates into the Simulator but they did not show up in the Settings - Profiles section. Then after some searching I discovered this tool. There are probably a few other tools out there but in my case the drag-and-drop never worked correctly for all cases. Safari would be fine but not my applications.

提交回复
热议问题