{"id":547,"date":"2017-07-14T20:27:20","date_gmt":"2017-07-14T14:57:20","guid":{"rendered":"https:\/\/www.lguruprasad.in\/blog\/?p=547"},"modified":"2020-05-06T17:05:03","modified_gmt":"2020-05-06T11:35:03","slug":"setting-up-synergy-1-8-8-with-ssl-on-os-x-el-capitan-as-the-server-and-ubuntu-16-04-as-the-client","status":"publish","type":"post","link":"https:\/\/www.lguruprasad.in\/blog\/2017\/07\/14\/setting-up-synergy-1-8-8-with-ssl-on-os-x-el-capitan-as-the-server-and-ubuntu-16-04-as-the-client\/","title":{"rendered":"Setting up Synergy 1.8.8 with SSL on OS X El Capitan as the server and Ubuntu 16.04 as the client"},"content":{"rendered":"<p><strong>Update (May 2020): <\/strong>Use <a href=\"https:\/\/github.com\/debauchee\/barrier\" target=\"_blank\" rel=\"noopener noreferrer\">Barrier<\/a>, which is a maintained fork of Synergy that supports SSL by default and has builds for Windows, macOS and Linux.<\/p>\n<p>Synergy is a <a href=\"https:\/\/www.gnu.org\/philosophy\/free-sw.en.html\" target=\"_blank\" rel=\"noopener noreferrer\">free and open source\u00a0software<\/a> (licensed under GPLv2) for sharing one keyboard and mouse between multiple computers. The source is hosted <a href=\"https:\/\/github.com\/symless\/synergy\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a> on GitHub and the <a href=\"https:\/\/symless.com\/synergy\" target=\"_blank\" rel=\"noopener noreferrer\">Synergy website<\/a>\u00a0provides compiled, installable releases with support for SSL encryption for a fee.<\/p>\n<p>At work, I have a Macbook Pro laptop running OS X El Capitan and an Ubuntu 16.04 desktop connected to a monitor which I use daily. Working on two separate computers at the same time is laborious and thanks to <a href=\"http:\/\/theindiangeek.in\/about\/\" target=\"_blank\" rel=\"noopener noreferrer\">Hiemanshu<\/a>, I came to know about Synergy.<\/p>\n<p>Eager to try it out, I built it from source after patching (to use the Qt installed on my Macbook using Macports) and with minimal configuration, I was able to get it to work. But since my computers were connected to the corporate network, I did not want my keystrokes to be sent through the network in plaintext. So till today, I used an SSH tunnel between my Macbook acting as the server and the Ubuntu desktop acting as a client. It was a little bit inconvenient having to setup the SSH tunnels every time and I didn&#8217;t want to use something like <code>autossh<\/code>.<\/p>\n<p>Imho, in the post-Snowden era, any software sending sensitive plaintext data through the network is broken by design. Since Synergy is free software, I was hoping to patch it to allow SSL communication without requiring a license. With some help from the comments and pull requests on the Synergy GitHub repository and some additional tweaking, I was able to build Synergy 1.8.8 with support for SSL irrespective of the licensing status.<\/p>\n<p>The following details of how I managed to do it are primarily for my reference and I am sharing it on my blog in the hope that it might be useful for others as well. That said, Synergy is a very useful free\/libre software and I recommend purchasing a license to support the development. One of the Synergy developers has <a href=\"https:\/\/github.com\/symless\/synergy\/issues\/5810#issuecomment-311406793\" target=\"_blank\" rel=\"noopener noreferrer\">committed to enable SSL communication by default in the 2.0 version<\/a>.<\/p>\n<p><b>Steps to be followed on OS X El Capitan<\/b><\/p>\n<ul>\n<li>Clone the Synergy <a href=\"https:\/\/github.com\/symless\/synergy\" target=\"_blank\" rel=\"noopener noreferrer\">GitHub repository<\/a> from \u00a0and checkout the <code>1.8.8-stable<\/code> branch<\/li>\n<li>Apply <a href=\"https:\/\/www.lguruprasad.in\/blog\/wp-content\/uploads\/2017\/07\/patch.diff\" target=\"_blank\" rel=\"noopener noreferrer\">this patch<\/a> to fix the Qt related paths and also to enable SSL without license check. For Qt installed without using Macports, tweak the <code>frameworkRootDir<\/code> variable in the patch to point to the correct directory. Also tweak the path to the <code>Info.plist<\/code> to point to a valid path.<\/li>\n<li>If the Mac OS X 10.11 SDK is not present under the <code>\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/MacOSX.platform\/Developer\/SDKs<\/code> directory, Download it from <a href=\"https:\/\/github.com\/phracker\/MacOSX-SDKs\" target=\"_blank\" rel=\"noopener noreferrer\">this GitHub repository<\/a> and copy it to that directory.<\/li>\n<li>Install the dependencies of Synergy (<code>cmake<\/code>, <code>qt5<\/code>) using Macports.<\/li>\n<li>Navigate to the top-level directory of the repository and run <code>.\/hm.sh conf -g2 --mac-sdk 10.12 --mac-identity ElCapitan<\/code> where the current OS is El Capitan and the available default Mac OS X SDK is 10.12. Modify the parameters based on the available SDKs and the OS version.<\/li>\n<li>After the previous command completes without errors, run <code>.\/hm.sh build<\/code> to start the build process.<\/li>\n<li>To create a Mac app, run <code>.\/hm.sh dist mac<\/code>.<\/li>\n<li>The <code>Synergy.app<\/code> is available under <code>bin\/Release\/Synergy<\/code> directory. Drag and drop it to the <code>\/Applications<\/code> directory.<\/li>\n<li>Create the SSL certificate needed by the Synergy server by running the following commands\n<pre>mkdir -p ~\/.synergy\/SSL\/Fingerprints\nopenssl req -x509 -nodes -days 365 -subj \/CN=Synergy -newkey rsa:1024 -keyout ~\/.synergy\/SSL\/Synergy.pem -out ~\/.synergy\/SSL\/Synergy.pem\nopenssl x509 -fingerprint -sha1 -noout -in ~\/.synergy\/SSL\/Synergy.pem &gt; ~\/.synergy\/SSL\/Fingerprints\/Local.txt\nmkdir -p ~\/Library\/Synergy\/SSL\/.\ncp ~\/.synergy\/SSL\/Synergy.pem ~\/Library\/Synergy\/SSL\/.\nsed -e \"s\/.*=\/\/\" -i ~\/.synergy\/SSL\/Fingerprints\/Local.txt\n<\/pre>\n<\/li>\n<li>Enable Accessibility permissions for the Synergy app from the <code>Security and Privacy<\/code> dialog under <code>System Preferences<\/code>.<\/li>\n<li>Start the Synergy app and run it as a server. The app window should indicate that SSL is turned on and the logs should not have any errors.<\/li>\n<\/ul>\n<p><strong>Steps to be followed on Ubuntu 16.04<\/strong><\/p>\n<ul>\n<li>Clone the <a href=\"https:\/\/github.com\/symless\/synergy\" target=\"_blank\" rel=\"noopener noreferrer\">Synergy GitHub repository<\/a> from \u00a0and checkout the <code>1.8.8-stable<\/code> branch.<\/li>\n<li>Apply <a href=\"https:\/\/www.lguruprasad.in\/blog\/wp-content\/uploads\/2017\/07\/patch.diff\" target=\"_blank\" rel=\"noopener noreferrer\">this patch<\/a> to fix the Qt related paths (not needed on Ubuntu) and also to enable SSL without license check.<\/li>\n<li>Install the dependencies by running the following command\n<pre>sudo apt-get install cmake make g++ xorg-dev libqt4-dev libcurl4-openssl-dev libavahi-compat-libdnssd-dev libssl-dev libx11-dev\n<\/pre>\n<\/li>\n<li>Navigate to the top-level synergy repository directory and run\n<pre>.\/hm.sh conf -g1; .\/hm.sh build; .\/hm.sh; .\/hm package deb\n<\/pre>\n<p>This builds Synergy and creates a <code>.deb<\/code> package file under the <code>bin<\/code> directory.<\/li>\n<li>Install the <code>.deb<\/code> file using <code>dpkg<\/code>.<\/li>\n<li>Start the Synergy app from the Unity launcher (or alternatively using its full path).<\/li>\n<li>Configure it as a client and set the server address to that of the computer running the server.<\/li>\n<li>The app will display the server&#8217;s certificate fingerprint with a prompt to trust or reject it. Trust the fingerprint after carefully verifying it. If there are any errors with the server fingerprint or trusting it, copy the <code>Local.txt<code> file generated on the server and save it under <code>~\/.synergy\/SSL\/Fingerprints<\/code> and restart the client.<\/code><\/code><\/li>\n<\/ul>\n<p><strong>References:<\/strong><\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/symless\/synergy\/wiki\/Compiling\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/github.com\/symless\/synergy\/wiki\/Compiling<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/symless\/synergy\/wiki\/Security\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/github.com\/symless\/synergy\/wiki\/Security<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/symless\/synergy\/wiki\/User-Guide\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/github.com\/symless\/synergy\/wiki\/User-Guide<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Update (May 2020): Use Barrier, which is a maintained fork of Synergy that supports SSL by default and has builds for Windows, macOS and Linux. Synergy is a free and open source\u00a0software (licensed under GPLv2) for sharing one keyboard and mouse between multiple computers. The source is hosted here on GitHub and the Synergy website\u00a0provides [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_s2mail":"yes","activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[12,271,34],"tags":[275,273,274,276,272,259],"class_list":["post-547","post","type-post","status-publish","format-standard","hentry","category-foss","category-os-x","category-ubuntu","tag-foss","tag-keyboard-mouse-sharing","tag-os-x","tag-ssl","tag-synergy","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/www.lguruprasad.in\/blog\/wp-json\/wp\/v2\/posts\/547","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lguruprasad.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lguruprasad.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lguruprasad.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lguruprasad.in\/blog\/wp-json\/wp\/v2\/comments?post=547"}],"version-history":[{"count":6,"href":"https:\/\/www.lguruprasad.in\/blog\/wp-json\/wp\/v2\/posts\/547\/revisions"}],"predecessor-version":[{"id":628,"href":"https:\/\/www.lguruprasad.in\/blog\/wp-json\/wp\/v2\/posts\/547\/revisions\/628"}],"wp:attachment":[{"href":"https:\/\/www.lguruprasad.in\/blog\/wp-json\/wp\/v2\/media?parent=547"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lguruprasad.in\/blog\/wp-json\/wp\/v2\/categories?post=547"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lguruprasad.in\/blog\/wp-json\/wp\/v2\/tags?post=547"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}