Skip to content

Commit

Permalink
(network) proxy: steps for tvOS
Browse files Browse the repository at this point in the history
  • Loading branch information
SensehacK committed May 17, 2024
1 parent 5608633 commit efef85e
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 7 deletions.
37 changes: 35 additions & 2 deletions network/charles_proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Enable SSL proxying for specific URLs or wildcards if needed.

## Process

Charles generates a `.pem` file - Privacy Enhanced Mail (PEM)
Charles generates a `.pem` file - Privacy Enhanced Mail (PEM) or `Base64 encoded certificate` as per Charles dialog box.
How `.pem` file differs from regular old OpenSSL key file - good thread to read [here](https://serverfault.com/questions/9708/what-is-a-pem-file-and-how-does-it-differ-from-other-openssl-generated-key-file)

```pem
Expand All @@ -19,9 +19,42 @@ MIIFVjCCBD6gAwIBAgIGAYlG5S1aMA0GCSqGSIb3DQEBCwUAMIGvMUAwPgYDVQQDDDdDaGFybGVz+VY=


Generating one is easy while using fastlane tool on macOS
https://docs.fastlane.tools/actions/pem/
[docs fastlane | pem](https://docs.fastlane.tools/actions/pem/)


## Generate Certificate

Go to `Charles` -> Help -> SSL Proxying -> Save Charles Root Certificate.
You can save it as `.pem` Base 64 encoded certificate or
`.cer` Binary Certificate



## tvOS

If you want to configure for a physical tvOS apple tv 4K, you need few things to set it up.

- [Apple Configurator | app store](https://apps.apple.com/us/app/apple-configurator/id1037126344)
- Charles Proxy 5.xx Beta
- Apple TV 4K
- Same Wifi network with manual DHCP address reservation
- [node package manager](tools/terminal/node#Node%20Version%20Manager)

### Steps

- download charles proxy `downloadedProfile.pem` from Menu -> Help -> SSL Proxying -> Save Charles Root Certificate... ” save it as `.cer` Binary Certificate `downloadedProfile.cer`
- Apple configurator -> File -> New Profile -> Name the profile "customTVOS_proxy" -> Select "Wifi", click "Configure"
- Fill your usual Wifi SSID (name: WifiName) & make sure `Proxy Setup` is selected to manual with provided `ProxyMan` Server and Port address eg. `10.0.0.22:9090`
- select “Certificates” → Click “Configure” → upload the `downloadedProfile.cer` file that you previously downloaded & renamed.
- save the profile `tvOSProxyProfile.mobileconfig` at accessible location & open a terminal at that `$pwd`
- Run a temporary [http server](tools/server/http-server#Node) using node
- Make sure appleTV is on the same Wifi network 2.4 or 5Ghz and open Settings -> General -> Privacy & Security -> Share Apple TV Analytics. Press apple tv remote physical button `Play/Pause` new window will appear.
- Select `Add Profile`, add the mac http server ip address with port and local file complete path. eg: `http://10.0.0.22:8033/tvOSProxyProfile.mobileconfig` (easier to copy paste from mac shared clipboard to iPhone + tv remote Input prompt)
- Select "Install", few times and then we need to trust the certificate by heading over to Settings -> General -> About -> Certificate Trust Settings -> Click on Proxy Profile -> “Continue”.
- You may need to reenter your WiFi credentials again since for me it got disconnected once with tvOS 17.0 - apple TV 4K 2023.

Now you can see the logs of Apple tv 4K on Charles Proxy. I believe similar steps could be performed for [proxyman](proxyman.md)

## Troubleshooting

### My internet connection doesn't work
Expand Down
46 changes: 42 additions & 4 deletions network/proxyman.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,54 @@
## Intro

Great tool for 21st century with proper macos UI mechanisms.
This works 100% of the time for getting my ios or networking debugging things work for me.
This works 100% of the time for getting my iOS or networking debugging things work for me.


## Official documentation
https://docs.proxyman.io/

[docs.proxyman.io](https://docs.proxyman.io/)



SSL proxying

https://docs.proxyman.io/basic-features/ssl-proxying
[docs | ssl-proxying](https://docs.proxyman.io/basic-features/ssl-proxying)


Breakpoints support
https://docs.proxyman.io/proxyman-ios/breakpoint-for-ios
[docs | breakpoint-for-ios](https://docs.proxyman.io/proxyman-ios/breakpoint-for-ios)



## Open source CLI tool

[mitmproxy](https://mitmproxy.org/)

```sh
brew install mitmproxy
```

## tvOS

If you want to configure for a physical tvOS apple tv 4K, you need few things to set it up.

- [Apple Configurator | app store](https://apps.apple.com/us/app/apple-configurator/id1037126344)
- Proxyman
- Apple TV 4K
- Same Wifi network with manual DHCP address reservation
- [node package manager](tools/terminal/node#Node%20Version%20Manager)

### Steps

- download proxyman `downloadedProfile.pem` from “[http://proxy.man/ssl](http://proxy.man/ssl)” & rename it to `downloadedProfile.cer`
- Apple configurator -> File -> New Profile -> Name the profile "customTVOS_proxy" -> Select "Wifi", click "Configure"
- Fill your usual Wifi SSID (name: WifiName) & make sure `Proxy Setup` is selected to manual with provided `ProxyMan` Server and Port address eg. `10.0.0.22:9090`
- select “Certificates” → Click “Configure” → upload the `downloadedProfile.cer` file that you previously downloaded & renamed.
- save the profile `tvOSProxyProfile.mobileconfig` at accessible location & open a terminal at that `$pwd`
- Run a temporary [http server](tools/server/http-server#Node) using node
- Make sure appleTV is on the same Wifi network 2.4 or 5Ghz and open Settings -> General -> Privacy & Security -> Share Apple TV Analytics. Press apple tv remote physical button `Play/Pause` new window will appear.
- Select `Add Profile`, add the mac http server ip address with port and local file complete path. eg: `http://10.0.0.22:8033/tvOSProxyProfile.mobileconfig` (easier to copy paste from mac shared clipboard to iPhone + tv remote Input prompt)
- Select "Install", few times and then we need to trust the certificate by heading over to Settings -> General -> About -> Certificate Trust Settings -> Click on Proxy Profile -> “Continue”.
- You may need to reenter your WiFi credentials again since for me it got disconnected once with tvOS 17.0 - apple TV 4K 2023.

Now you can see the logs of Apple tv 4K on Proxy man. I believe similar steps could be performed for [Charles proxy](charles_proxy.md)
20 changes: 19 additions & 1 deletion tools/server/http-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
To run a local server to host the website. As running a local server isn’t in the scope of this tutorial and also isn’t essential to it, it’s only briefly mentioned.

If you have Python 3 installed, you can run the command

```bash
python3 -m http.server -d $directory_name`
```
Expand All @@ -14,4 +15,21 @@ If your macOS doesn’t have Python, you can install it with homebrew

```bash
brew install python3
```
```


## Node

Create a quick server at the `$pwd` directory.

```sh
npx http-server --port 8001
```



## References

[github package](https://github.com/http-party/http-server)

[http-server npm](https://www.npmjs.com/package/http-server)

0 comments on commit efef85e

Please sign in to comment.