diff --git a/simplexmq.cabal b/simplexmq.cabal index a7f130e9f..e97f715e6 100644 --- a/simplexmq.cabal +++ b/simplexmq.cabal @@ -41,6 +41,7 @@ library Simplex.Messaging.Agent.Store.SQLite.Migrations Simplex.Messaging.Agent.Store.SQLite.Migrations.M20220101_initial Simplex.Messaging.Agent.Store.SQLite.Migrations.M20220301_snd_queue_keys + Simplex.Messaging.Agent.Store.SQLite.Migrations.M20220320_server_ips Simplex.Messaging.Client Simplex.Messaging.Crypto Simplex.Messaging.Crypto.Ratchet diff --git a/src/Simplex/Messaging/Agent/Store/SQLite/Migrations/M20220320_server_ips.hs b/src/Simplex/Messaging/Agent/Store/SQLite/Migrations/M20220320_server_ips.hs new file mode 100644 index 000000000..6660f605a --- /dev/null +++ b/src/Simplex/Messaging/Agent/Store/SQLite/Migrations/M20220320_server_ips.hs @@ -0,0 +1,14 @@ +{-# LANGUAGE QuasiQuotes #-} + +module Simplex.Messaging.Agent.Store.SQLite.Migrations.M20220320_server_ips where + +import Database.SQLite.Simple (Query) +import Database.SQLite.Simple.QQ (sql) + +m20220301_snd_queue_keys :: Query +m20220301_snd_queue_keys = + [sql| +UPDATE servers SET host = '178.79.168.175' WHERE host = 'smp8.simplex.im'; +UPDATE servers SET host = '178.79.169.107' WHERE host = 'smp9.simplex.im'; +UPDATE servers SET host = '45.33.54.229' WHERE host = 'smp10.simplex.im'; +|] diff --git a/src/Simplex/Messaging/Transport/Client.hs b/src/Simplex/Messaging/Transport/Client.hs index 29bff966c..cb9a24ef2 100644 --- a/src/Simplex/Messaging/Transport/Client.hs +++ b/src/Simplex/Messaging/Transport/Client.hs @@ -75,7 +75,7 @@ validateCertificateChain (C.KeyHash kh) host port cc@(X.CertificateChain sc@[_, x509validate = XV.validate X.HashSHA256 hooks checks certStore cache serviceID cc where hooks = XV.defaultHooks - checks = XV.defaultChecks + checks = XV.defaultChecks {XV.checkFQHN = False} certStore = XS.makeCertificateStore sc cache = XV.exceptionValidationCache [] -- we manually check fingerprint only of the identity certificate (ca.crt) serviceID = (host, port) diff --git a/tests/AgentTests.hs b/tests/AgentTests.hs index 6885fa8e6..3867589d4 100644 --- a/tests/AgentTests.hs +++ b/tests/AgentTests.hs @@ -468,7 +468,7 @@ syntaxTests t = do "a", "JOIN https://simpex.chat/invitation#/?smp=smp%3A%2F%2F" <> urlEncode True "LcJUMfVhwD8yxjAiSaDzzGF3-kLG4Uh0Fl_ZIjrRwjI=" - <> "%40localhost%3A5001%2F3456-w%3D%3D%23" + <> "%40127.0.0.1%3A5001%2F3456-w%3D%3D%23" <> urlEncode True sampleDhKey <> "&v=1" <> "&e2e=v%3D1%26x3dh%3DMEIwBQYDK2VvAzkAmKuSYeQ_m0SixPDS8Wq8VBaTS1cW-Lp0n0h4Diu-kUpR-qXx4SDJ32YGEFoGFGSbGPry5Ychr6U%3D%2CMEIwBQYDK2VvAzkAmKuSYeQ_m0SixPDS8Wq8VBaTS1cW-Lp0n0h4Diu-kUpR-qXx4SDJ32YGEFoGFGSbGPry5Ychr6U%3D" diff --git a/tests/SMPAgentClient.hs b/tests/SMPAgentClient.hs index 8c144509e..07da28db4 100644 --- a/tests/SMPAgentClient.hs +++ b/tests/SMPAgentClient.hs @@ -157,7 +157,7 @@ cfg :: AgentConfig cfg = defaultAgentConfig { tcpPort = agentTestPort, - initialSMPServers = L.fromList ["smp://LcJUMfVhwD8yxjAiSaDzzGF3-kLG4Uh0Fl_ZIjrRwjI=@localhost:5001"], + initialSMPServers = L.fromList ["smp://LcJUMfVhwD8yxjAiSaDzzGF3-kLG4Uh0Fl_ZIjrRwjI=@127.0.0.1:5001"], tbqSize = 1, dbFile = testDB, smpCfg = @@ -174,7 +174,7 @@ cfg = withSmpAgentThreadOn_ :: (MonadUnliftIO m, MonadRandom m) => ATransport -> (ServiceName, ServiceName, String) -> m () -> (ThreadId -> m a) -> m a withSmpAgentThreadOn_ t (port', smpPort', db') afterProcess = - let cfg' = cfg {tcpPort = port', dbFile = db', initialSMPServers = L.fromList [SMPServer "localhost" smpPort' testKeyHash]} + let cfg' = cfg {tcpPort = port', dbFile = db', initialSMPServers = L.fromList [SMPServer "127.0.0.1" smpPort' testKeyHash]} in serverBracket (\started -> runSMPAgentBlocking t started cfg') afterProcess diff --git a/tests/SMPClient.hs b/tests/SMPClient.hs index 7d4352c1a..f3a4c2815 100644 --- a/tests/SMPClient.hs +++ b/tests/SMPClient.hs @@ -29,7 +29,7 @@ import UnliftIO.STM (TMVar, atomically, newEmptyTMVarIO, takeTMVar) import UnliftIO.Timeout (timeout) testHost :: HostName -testHost = "localhost" +testHost = "127.0.0.1" testPort :: ServiceName testPort = "5001"