From 6648b41d0a6b67e88fe808ef83cee3a760a0941f Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Mon, 22 Jul 2019 14:01:23 +0100 Subject: [PATCH] Update melpa setup code --- core/siren-packages.el | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/core/siren-packages.el b/core/siren-packages.el index a216ed6..413b144 100644 --- a/core/siren-packages.el +++ b/core/siren-packages.el @@ -9,8 +9,20 @@ (require 'cl) (require 'package) -(add-to-list 'package-archives - '("melpa" . "http://melpa.org/packages/") t) +(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos)) + (not (gnutls-available-p)))) + (proto (if no-ssl "http" "https"))) + (when no-ssl + (warn "\ +Your version of Emacs does not support SSL connections, +which is unsafe because it allows man-in-the-middle attacks. +There are two things you can do about this warning: +1. Install an Emacs version that does support SSL and be safe. +2. Remove this warning from your init file so you won't see it again.")) + ;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired + (add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t) + ;;(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t) + ) ;; set package-user-dir to be relative to config path (setq package-user-dir (expand-file-name "elpa" siren-dir))