{"action":"created","comment":{"url":"https://api.github.com/repos/libgit2/libgit2/pulls/comments/136778185","pull_request_review_id":60362882,"id":136778185,"diff_hunk":"@@ -151,6 +141,64 @@ ELSE ()\n \tADD_FEATURE_INFO(cURL GIT_CURL \"cURL for HTTP proxy support\")\n ENDIF()\n \n+# Auto-select TLS backend\n+IF(USE_HTTPS STREQUAL ON)\n+\tIF (SECURITY_FOUND)\n+\t\tIF (SECURITY_HAS_SSLCREATECONTEXT)\n+\t\t\tSET(HTTPS_BACKEND \"SecureTransport\")\n+\t\tELSE()\n+\t\t\tMESSAGE(\"-- Security framework is too old, falling back to OpenSSL\")\n+\t\t\tSET(HTTPS_BACKEND \"OpenSSL\")\n+\t\tENDIF()\n+\tELSEIF(WINHTTP)\n+\t\tSET(HTTPS_BACKEND \"WinHTTP\")\n+\tELSE()\n+\t\tSET(HTTPS_BACKEND \"OpenSSL\")\n+\tENDIF()\n+ELSE()\n+\tSET(HTTPS_BACKEND ${USE_HTTPS})\n+ENDIF()\n+\n+IF(HTTPS_BACKEND STREQUAL \"SecureTransport\")\n+\tIF (NOT SECURITY_FOUND)\n+\t\tMESSAGE(FATAL_ERROR \"Asked for SecureTransport TLS backend, but it wasn't found\")\n+\tENDIF()\n+\tIF (NOT SECURITY_HAS_SSLCREATECONTEXT)\n+\t\tMESSAGE(FATAL_ERROR \"Asked for SecureTransport TLS backend, but it doesn't support SSLCreateContext\")\n+\tENDIF()\n+\n+\tSET(GIT_SECURE_TRANSPORT 1)\n+\tLIST(APPEND LIBGIT2_INCLUDES ${SECURITY_INCLUDE_DIR})\n+\tLIST(APPEND LIBGIT2_LIBS ${SECURITY_LIBRARIES})\n+\tLIST(APPEND LIBGIT2_PC_LIBS ${SECURITY_LDFLAGS})\n+ELSEIF(HTTPS_BACKEND STREQUAL \"OpenSSL\")\n+\tIF (NOT OPENSSL_FOUND)\n+\t\tMESSAGE(FATAL_ERROR \"Asked for OpenSSL TLS backend, but it wasn't found\")\n+\tENDIF()\n+\n+\tSET(GIT_OPENSSL 1)\n+\tLIST(APPEND LIBGIT2_INCLUDES ${OPENSSL_INCLUDE_DIR})\n+\tLIST(APPEND LIBGIT2_LIBS ${OPENSSL_LIBRARIES})\n+\tLIST(APPEND LIBGIT2_PC_LIBS ${OPENSSL_LDFLAGS})\n+ELSEIF(HTTPS_BACKEND STREQUAL \"WinHTTP\")\n+\t# WinHTTP setup was handled in the WinHTTP-specific block above\n+ELSEIF(NOT(HTTPS_BACKEND))\n+\t# The auto-selection wasn't able to auto-select, this will error below\n+ELSE()\n+\tMESSAGE(FATAL_ERROR \"Unknown backend ${HTTPS_BACKEND}\")\n+ENDIF()\n+\n+IF(USE_HTTPS AND NOT HTTPS_BACKEND)\n+\tMESSAGE(FATAL_ERROR \"Asked for backend ${HTTPS_BACKEND} but it wasn't found\")","path":"src/CMakeLists.txt","position":117,"original_position":85,"commit_id":"3d4cef57ca15a882e5cc8712bdbf3a7de2054a38","original_commit_id":"3d4cef57ca15a882e5cc8712bdbf3a7de2054a38","user":{"login":"tiennou","id":81099,"avatar_url":"https://avatars1.githubusercontent.com/u/81099?v=4","gravatar_id":"","url":"https://api.github.com/users/tiennou","html_url":"https://github.com/tiennou","followers_url":"https://api.github.com/users/tiennou/followers","following_url":"https://api.github.com/users/tiennou/following{/other_user}","gists_url":"https://api.github.com/users/tiennou/gists{/gist_id}","starred_url":"https://api.github.com/users/tiennou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiennou/subscriptions","organizations_url":"https://api.github.com/users/tiennou/orgs","repos_url":"https://api.github.com/users/tiennou/repos","events_url":"https://api.github.com/users/tiennou/events{/privacy}","received_events_url":"https://api.github.com/users/tiennou/received_events","type":"User","site_admin":false},"body":"Actually, it should trigger when manually asking for a backend we don't support (eg. `-DUSE_HTTPS=gnuTLS`). Otherwise, with `-DUSE_HTTPS=ON` (the default) the automatic detection will auto-select OpenSSL, which will hard-fail if we can't find OpenSSL (which is what we want, since we can't obey USE_HTTPS).\r\n\r\nI'm confused now... I'll try to come up with a cleaner set of `IF` blocks then.","created_at":"2017-09-04T09:18:49Z","updated_at":"2017-09-04T09:18:50Z","html_url":"https://github.com/libgit2/libgit2/pull/4283#discussion_r136778185","pull_request_url":"https://api.github.com/repos/libgit2/libgit2/pulls/4283","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/libgit2/libgit2/pulls/comments/136778185"},"html":{"href":"https://github.com/libgit2/libgit2/pull/4283#discussion_r136778185"},"pull_request":{"href":"https://api.github.com/repos/libgit2/libgit2/pulls/4283"}},"in_reply_to_id":136503531},"pull_request":{"url":"https://api.github.com/repos/libgit2/libgit2/pulls/4283","id":127301703,"html_url":"https://github.com/libgit2/libgit2/pull/4283","diff_url":"https://github.com/libgit2/libgit2/pull/4283.diff","patch_url":"https://github.com/libgit2/libgit2/pull/4283.patch","issue_url":"https://api.github.com/repos/libgit2/libgit2/issues/4283","number":4283,"state":"open","locked":false,"title":"CMake: make HTTPS support more generic","user":{"login":"tiennou","id":81099,"avatar_url":"https://avatars1.githubusercontent.com/u/81099?v=4","gravatar_id":"","url":"https://api.github.com/users/tiennou","html_url":"https://github.com/tiennou","followers_url":"https://api.github.com/users/tiennou/followers","following_url":"https://api.github.com/users/tiennou/following{/other_user}","gists_url":"https://api.github.com/users/tiennou/gists{/gist_id}","starred_url":"https://api.github.com/users/tiennou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiennou/subscriptions","organizations_url":"https://api.github.com/users/tiennou/orgs","repos_url":"https://api.github.com/users/tiennou/repos","events_url":"https://api.github.com/users/tiennou/events{/privacy}","received_events_url":"https://api.github.com/users/tiennou/received_events","type":"User","site_admin":false},"body":"Extracted from #4173 and rebased on master, switched to the new HTTPS nomenclature while keeping most of the functional changes.","created_at":"2017-06-23T22:51:28Z","updated_at":"2017-09-04T09:18:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3fc55b6c9df1a9579a7ba240c64f2ce83f1b9cca","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/libgit2/libgit2/pulls/4283/commits","review_comments_url":"https://api.github.com/repos/libgit2/libgit2/pulls/4283/comments","review_comment_url":"https://api.github.com/repos/libgit2/libgit2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/libgit2/libgit2/issues/4283/comments","statuses_url":"https://api.github.com/repos/libgit2/libgit2/statuses/3d4cef57ca15a882e5cc8712bdbf3a7de2054a38","head":{"label":"tiennou:generic-tls","ref":"generic-tls","sha":"3d4cef57ca15a882e5cc8712bdbf3a7de2054a38","user":{"login":"tiennou","id":81099,"avatar_url":"https://avatars1.githubusercontent.com/u/81099?v=4","gravatar_id":"","url":"https://api.github.com/users/tiennou","html_url":"https://github.com/tiennou","followers_url":"https://api.github.com/users/tiennou/followers","following_url":"https://api.github.com/users/tiennou/following{/other_user}","gists_url":"https://api.github.com/users/tiennou/gists{/gist_id}","starred_url":"https://api.github.com/users/tiennou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiennou/subscriptions","organizations_url":"https://api.github.com/users/tiennou/orgs","repos_url":"https://api.github.com/users/tiennou/repos","events_url":"https://api.github.com/users/tiennou/events{/privacy}","received_events_url":"https://api.github.com/users/tiennou/received_events","type":"User","site_admin":false},"repo":{"id":11159911,"name":"libgit2","full_name":"tiennou/libgit2","owner":{"login":"tiennou","id":81099,"avatar_url":"https://avatars1.githubusercontent.com/u/81099?v=4","gravatar_id":"","url":"https://api.github.com/users/tiennou","html_url":"https://github.com/tiennou","followers_url":"https://api.github.com/users/tiennou/followers","following_url":"https://api.github.com/users/tiennou/following{/other_user}","gists_url":"https://api.github.com/users/tiennou/gists{/gist_id}","starred_url":"https://api.github.com/users/tiennou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiennou/subscriptions","organizations_url":"https://api.github.com/users/tiennou/orgs","repos_url":"https://api.github.com/users/tiennou/repos","events_url":"https://api.github.com/users/tiennou/events{/privacy}","received_events_url":"https://api.github.com/users/tiennou/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tiennou/libgit2","description":"The Library","fork":true,"url":"https://api.github.com/repos/tiennou/libgit2","forks_url":"https://api.github.com/repos/tiennou/libgit2/forks","keys_url":"https://api.github.com/repos/tiennou/libgit2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tiennou/libgit2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tiennou/libgit2/teams","hooks_url":"https://api.github.com/repos/tiennou/libgit2/hooks","issue_events_url":"https://api.github.com/repos/tiennou/libgit2/issues/events{/number}","events_url":"https://api.github.com/repos/tiennou/libgit2/events","assignees_url":"https://api.github.com/repos/tiennou/libgit2/assignees{/user}","branches_url":"https://api.github.com/repos/tiennou/libgit2/branches{/branch}","tags_url":"https://api.github.com/repos/tiennou/libgit2/tags","blobs_url":"https://api.github.com/repos/tiennou/libgit2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tiennou/libgit2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tiennou/libgit2/git/refs{/sha}","trees_url":"https://api.github.com/repos/tiennou/libgit2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tiennou/libgit2/statuses/{sha}","languages_url":"https://api.github.com/repos/tiennou/libgit2/languages","stargazers_url":"https://api.github.com/repos/tiennou/libgit2/stargazers","contributors_url":"https://api.github.com/repos/tiennou/libgit2/contributors","subscribers_url":"https://api.github.com/repos/tiennou/libgit2/subscribers","subscription_url":"https://api.github.com/repos/tiennou/libgit2/subscription","commits_url":"https://api.github.com/repos/tiennou/libgit2/commits{/sha}","git_commits_url":"https://api.github.com/repos/tiennou/libgit2/git/commits{/sha}","comments_url":"https://api.github.com/repos/tiennou/libgit2/comments{/number}","issue_comment_url":"https://api.github.com/repos/tiennou/libgit2/issues/comments{/number}","contents_url":"https://api.github.com/repos/tiennou/libgit2/contents/{+path}","compare_url":"https://api.github.com/repos/tiennou/libgit2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tiennou/libgit2/merges","archive_url":"https://api.github.com/repos/tiennou/libgit2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tiennou/libgit2/downloads","issues_url":"https://api.github.com/repos/tiennou/libgit2/issues{/number}","pulls_url":"https://api.github.com/repos/tiennou/libgit2/pulls{/number}","milestones_url":"https://api.github.com/repos/tiennou/libgit2/milestones{/number}","notifications_url":"https://api.github.com/repos/tiennou/libgit2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tiennou/libgit2/labels{/name}","releases_url":"https://api.github.com/repos/tiennou/libgit2/releases{/id}","deployments_url":"https://api.github.com/repos/tiennou/libgit2/deployments","created_at":"2013-07-03T19:51:56Z","updated_at":"2014-03-31T22:21:50Z","pushed_at":"2017-08-28T23:25:03Z","git_url":"git://github.com/tiennou/libgit2.git","ssh_url":"git@github.com:tiennou/libgit2.git","clone_url":"https://github.com/tiennou/libgit2.git","svn_url":"https://github.com/tiennou/libgit2","homepage":"http://libgit2.github.com","size":23054,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"development"}},"base":{"label":"libgit2:master","ref":"master","sha":"3c21645360a0b06d6ed5f028e9517d65f8e11bc1","user":{"login":"libgit2","id":394745,"avatar_url":"https://avatars1.githubusercontent.com/u/394745?v=4","gravatar_id":"","url":"https://api.github.com/users/libgit2","html_url":"https://github.com/libgit2","followers_url":"https://api.github.com/users/libgit2/followers","following_url":"https://api.github.com/users/libgit2/following{/other_user}","gists_url":"https://api.github.com/users/libgit2/gists{/gist_id}","starred_url":"https://api.github.com/users/libgit2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libgit2/subscriptions","organizations_url":"https://api.github.com/users/libgit2/orgs","repos_url":"https://api.github.com/users/libgit2/repos","events_url":"https://api.github.com/users/libgit2/events{/privacy}","received_events_url":"https://api.github.com/users/libgit2/received_events","type":"Organization","site_admin":false},"repo":{"id":901662,"name":"libgit2","full_name":"libgit2/libgit2","owner":{"login":"libgit2","id":394745,"avatar_url":"https://avatars1.githubusercontent.com/u/394745?v=4","gravatar_id":"","url":"https://api.github.com/users/libgit2","html_url":"https://github.com/libgit2","followers_url":"https://api.github.com/users/libgit2/followers","following_url":"https://api.github.com/users/libgit2/following{/other_user}","gists_url":"https://api.github.com/users/libgit2/gists{/gist_id}","starred_url":"https://api.github.com/users/libgit2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libgit2/subscriptions","organizations_url":"https://api.github.com/users/libgit2/orgs","repos_url":"https://api.github.com/users/libgit2/repos","events_url":"https://api.github.com/users/libgit2/events{/privacy}","received_events_url":"https://api.github.com/users/libgit2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/libgit2/libgit2","description":"The Library","fork":false,"url":"https://api.github.com/repos/libgit2/libgit2","forks_url":"https://api.github.com/repos/libgit2/libgit2/forks","keys_url":"https://api.github.com/repos/libgit2/libgit2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/libgit2/libgit2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/libgit2/libgit2/teams","hooks_url":"https://api.github.com/repos/libgit2/libgit2/hooks","issue_events_url":"https://api.github.com/repos/libgit2/libgit2/issues/events{/number}","events_url":"https://api.github.com/repos/libgit2/libgit2/events","assignees_url":"https://api.github.com/repos/libgit2/libgit2/assignees{/user}","branches_url":"https://api.github.com/repos/libgit2/libgit2/branches{/branch}","tags_url":"https://api.github.com/repos/libgit2/libgit2/tags","blobs_url":"https://api.github.com/repos/libgit2/libgit2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/libgit2/libgit2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/libgit2/libgit2/git/refs{/sha}","trees_url":"https://api.github.com/repos/libgit2/libgit2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/libgit2/libgit2/statuses/{sha}","languages_url":"https://api.github.com/repos/libgit2/libgit2/languages","stargazers_url":"https://api.github.com/repos/libgit2/libgit2/stargazers","contributors_url":"https://api.github.com/repos/libgit2/libgit2/contributors","subscribers_url":"https://api.github.com/repos/libgit2/libgit2/subscribers","subscription_url":"https://api.github.com/repos/libgit2/libgit2/subscription","commits_url":"https://api.github.com/repos/libgit2/libgit2/commits{/sha}","git_commits_url":"https://api.github.com/repos/libgit2/libgit2/git/commits{/sha}","comments_url":"https://api.github.com/repos/libgit2/libgit2/comments{/number}","issue_comment_url":"https://api.github.com/repos/libgit2/libgit2/issues/comments{/number}","contents_url":"https://api.github.com/repos/libgit2/libgit2/contents/{+path}","compare_url":"https://api.github.com/repos/libgit2/libgit2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/libgit2/libgit2/merges","archive_url":"https://api.github.com/repos/libgit2/libgit2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/libgit2/libgit2/downloads","issues_url":"https://api.github.com/repos/libgit2/libgit2/issues{/number}","pulls_url":"https://api.github.com/repos/libgit2/libgit2/pulls{/number}","milestones_url":"https://api.github.com/repos/libgit2/libgit2/milestones{/number}","notifications_url":"https://api.github.com/repos/libgit2/libgit2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/libgit2/libgit2/labels{/name}","releases_url":"https://api.github.com/repos/libgit2/libgit2/releases{/id}","deployments_url":"https://api.github.com/repos/libgit2/libgit2/deployments","created_at":"2010-09-10T16:17:48Z","updated_at":"2017-09-03T03:34:42Z","pushed_at":"2017-09-02T17:01:58Z","git_url":"git://github.com/libgit2/libgit2.git","ssh_url":"git@github.com:libgit2/libgit2.git","clone_url":"https://github.com/libgit2/libgit2.git","svn_url":"https://github.com/libgit2/libgit2","homepage":"https://libgit2.github.com","size":36589,"stargazers_count":6172,"watchers_count":6172,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":1570,"mirror_url":null,"open_issues_count":221,"forks":1570,"open_issues":221,"watchers":6172,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/libgit2/libgit2/pulls/4283"},"html":{"href":"https://github.com/libgit2/libgit2/pull/4283"},"issue":{"href":"https://api.github.com/repos/libgit2/libgit2/issues/4283"},"comments":{"href":"https://api.github.com/repos/libgit2/libgit2/issues/4283/comments"},"review_comments":{"href":"https://api.github.com/repos/libgit2/libgit2/pulls/4283/comments"},"review_comment":{"href":"https://api.github.com/repos/libgit2/libgit2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/libgit2/libgit2/pulls/4283/commits"},"statuses":{"href":"https://api.github.com/repos/libgit2/libgit2/statuses/3d4cef57ca15a882e5cc8712bdbf3a7de2054a38"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"tiennou"}}