From 97b6af62fe45634906ec7063edc4fcafde1b0bea Mon Sep 17 00:00:00 2001
From: Takeshi Umeda <noel.yoshiba@gmail.com>
Date: Mon, 21 Oct 2019 00:41:12 +0900
Subject: [PATCH] Add ssl to elasticsearch config settings (#5527)

---
 src/config/types.ts                         | 1 +
 src/db/elasticsearch.ts                     | 2 +-
 src/remote/activitypub/kernel/move/index.ts | 0
 3 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 src/remote/activitypub/kernel/move/index.ts

diff --git a/src/config/types.ts b/src/config/types.ts
index 6a3fc3092a..b96e727506 100644
--- a/src/config/types.ts
+++ b/src/config/types.ts
@@ -29,6 +29,7 @@ export type Source = {
 		port: number;
 		pass: string;
 		index?: string;
+		ssl?: boolean;
 	};
 
 	autoAdmin?: boolean;
diff --git a/src/db/elasticsearch.ts b/src/db/elasticsearch.ts
index b34ebe605c..b62e17461a 100644
--- a/src/db/elasticsearch.ts
+++ b/src/db/elasticsearch.ts
@@ -32,7 +32,7 @@ const index = {
 
 // Init ElasticSearch connection
 const client = config.elasticsearch ? new elasticsearch.Client({
-	node: `http://${config.elasticsearch.host}:${config.elasticsearch.port}`,
+	node: `${config.elasticsearch.ssl ? 'https://' : 'http://'}${config.elasticsearch.host}:${config.elasticsearch.port}`,
 	pingTimeout: 30000
 }) : null;
 
diff --git a/src/remote/activitypub/kernel/move/index.ts b/src/remote/activitypub/kernel/move/index.ts
new file mode 100644
index 0000000000..e69de29bb2