diff --git a/README.md b/README.md index 4307d44..a3493ee 100644 --- a/README.md +++ b/README.md @@ -30,23 +30,23 @@ subdirectory. ### Step 2: Configure Zwift client to use zoffline -I've only done this with Windows 10 so your mileage may vary on other versions. +
Windows 10 Instructions * Install Zwift * If your Zwift version is newer than 1.0.28901 you may have to uninstall, then reinstall after installing zoffline. * If your Zwift version is 1.0.28901, you're all set. * If Zwift is not installed install it after installing zoffline (1.0.28901 will be installed instead of the latest). * On your Windows machine running Zwift, copy the following files in this repo to a known location: * ``ssl/cert-us-or.p12`` - * ``ssl/cert-zwift-secure.p12`` + * ``ssl/cert-secure-zwift.p12`` * ``ssl/cert-us-or.pem`` - * ``ssl/cert-zwift-secure.pem`` + * ``ssl/cert-secure-zwift.pem`` * Open Command Prompt as an admin, cd to that location and run * ``certutil.exe -importpfx Root cert-us-or.p12`` - * ``certutil.exe -importpfx Root cert-zwift-secure.p12`` + * ``certutil.exe -importpfx Root cert-secure-zwift.p12`` * Open Notepad as an admin and open ``C:\Program Files (x86)\Zwift\data\cacert.pem`` * Append the contents of ``ssl/cert-us-or.pem`` to cacert.pem - * Append the contents of ``ssl/cert-zwift-secure.pem`` to cacert.pem + * Append the contents of ``ssl/cert-secure-zwift.pem`` to cacert.pem * Open Notepad as an admin and open ``C:\Windows\System32\Drivers\etc\hosts`` * Append this line: `` us-or-rly101.zwift.com secure.zwift.com cdn.zwift.com``
(Where ```` is the ip address of the machine running zoffline. If @@ -55,6 +55,35 @@ I've only done this with Windows 10 so your mileage may vary on other versions. Why: We need to redirect Zwift to use zoffline and convince Windows and Zwift to accept zoffline's self signed certificates for Zwift's domain names. Feel free to generate your own certificates and do the same. +
+ +
Mac OS X Instructions (Thanks @oldnapalm!) +* Install Zwift + * If your Zwift version is newer than 1.0.28901 you may have to uninstall, then reinstall after installing zoffline. + * If your Zwift version is 1.0.28901, you're all set. + * If Zwift is not installed install it after installing zoffline (1.0.28901 will be installed instead of the latest). +* On your Mac machine running Zwift, copy the following files in this repo to a known location: + * ``ssl/cert-us-or.p12`` + * ``ssl/cert-secure-zwift.p12`` + * ``ssl/cert-us-or.pem`` + * ``ssl/cert-secure-zwift.pem`` +* Open Keychain Access, select "System" under "Keychains", select "Certificates" under "Category" + * Click "File - Import Items..." and import ``ssl/cert-secure-zwift.p12`` + * Right click "secure.zwift.com", select "Get Info" and under "Trust" choose "When using this certificate: Always Trust". + * Repeat this procedure with ``ssl/cert-us-or.p12`` ("us-or-rly101.zwift.com"). +* Using a text editor open ``~/Library/Application Support/Zwift/data/cacert.pem`` + * Append the contents of ``ssl/cert-us-or.pem`` to cacert.pem + * Append the contents of ``ssl/cert-secure-zwift.pem`` to cacert.pem +* Using a text editor (with admin privileges) open ``/etc/hosts`` + * Append this line: `` us-or-rly101.zwift.com secure.zwift.com cdn.zwift.com`` +
(Where ```` is the ip address of the machine running zoffline. If + it's running on the same machine as Zwift, use ``127.0.0.1`` as the ip.) + +Why: We need to redirect Zwift to use zoffline and convince OS X and Zwift to +accept zoffline's self signed certificates for Zwift's domain names. Feel free +to generate your own certificates and do the same. +
+ #### Enabling/Disabling zoffline diff --git a/auth_server.py b/auth_server.py index d22c8a9..7a1248f 100755 --- a/auth_server.py +++ b/auth_server.py @@ -6,7 +6,7 @@ from flask import Flask, request, jsonify, redirect app = Flask(__name__) -SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) +FAKE_TOKEN = '{"access_token":"abc","expires_in":10800,"refresh_expires_in":2592000,"refresh_token":"abc","token_type":"bearer","id_token":"abc","not-before-policy":1408458483,"session-state":"a-b-c"}' @app.route('/auth/rb_bf03269xbi', methods=['POST']) @@ -37,13 +37,21 @@ def auth_realms_zwift_protocol_openid_connect_registrations(): # Unused as it's a direct redirect now from auth/login @app.route('/auth/realms/zwift/login-actions/startriding', methods=['GET']) def auth_realms_zwift_login_actions_startriding(): - return redirect("http://zwift/?code=abc", code=302) - + return redirect("http://zwift/?code=abc", 302) @app.route('/auth/realms/zwift/protocol/openid-connect/token', methods=['POST']) def auth_realms_zwift_protocol_openid_connect_token(): - return '{"access_token":"abc","expires_in":10800,"refresh_expires_in":2592000,"refresh_token":"abc","token_type":"bearer","id_token":"abc","not-before-policy":1408458483,"session-state":"a-b-c"}', 200 + return FAKE_TOKEN, 200 +# Called by Mac, but not Windows +@app.route('/auth/realms/zwift/tokens/login', methods=['GET']) +def auth_realms_zwift_tokens_login(): + return redirect("http://zwift/?code=abc", 302) + +# Called by Mac, but not Windows +@app.route('/auth/realms/zwift/tokens/access/codes', methods=['POST']) +def auth_realms_zwift_tokens_access_codes(): + return FAKE_TOKEN, 200 if __name__ == "__main__": app.run(ssl_context=('ssl/cert-secure-zwift.pem', 'ssl/key-secure-zwift.pem'), diff --git a/cdn/gameassets/Zwift_Updates_Root/LauncherMac_ver_cur.xml b/cdn/gameassets/Zwift_Updates_Root/LauncherMac_ver_cur.xml new file mode 100644 index 0000000..9f9524e --- /dev/null +++ b/cdn/gameassets/Zwift_Updates_Root/LauncherMac_ver_cur.xml @@ -0,0 +1,2 @@ +