Skip to content
  • Home
  • Recent
  • Tags
  • 0 Unread 0
  • Categories
  • Unreplied
  • Popular
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. Skripten / Logik
  4. JavaScript
  5. Gotify "const axios" unable to verify the first certificate

NEWS

  • Neuer Blogbeitrag: Monatsrückblick - Dezember 2025 🎄
    BluefoxB
    Bluefox
    10
    1
    143

  • Weihnachtsangebot 2025! 🎄
    BluefoxB
    Bluefox
    24
    1
    1.4k

  • UPDATE 31.10.: Amazon Alexa - ioBroker Skill läuft aus ?
    apollon77A
    apollon77
    48
    3
    9.4k

Gotify "const axios" unable to verify the first certificate

Scheduled Pinned Locked Moved JavaScript
3 Posts 2 Posters 755 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    BenjaminCz
    wrote on last edited by BenjaminCz
    #1

    Hallo,
    ich habe den Selv Hostet Gotify benachrichtigungs Server der läuft erfolgreich auf HTTPS.

    Vorher hatte ich Gotify als HTTP am laufen und folgenden Code im Java Script dass hatte auch funktioniert.

    const axios = require("axios");
    
    const url = "http://192.168.178.xxx/message?token=ATvOgRNF8QqwGVN";
    const bodyFormData = {
      title: "Hello from Javascript",
      message: "Test Push Service from Node.js",
      priority: 5,
    };
    
    axios({
      method: "post",
      headers: {
        "Content-Type": "application/json",
      },
      url: url,
      data: bodyFormData,
    })
      .then((response) => console.log(response.data))
      .catch((err) => console.log(err.response ? error.response.data : err));
    

    Seit der Umstellung auf HTTPS habe ich den Code so angepasst: (nur HTTP zu HTTPS geändert)

    const axios = require("axios");
    
    const url = "https://192.168.178.xxx/message?token=ATvOgRNF8QqwGVN";
    const bodyFormData = {
      title: "Hello from Javascript",
      message: "Test Push Service from Node.js",
      priority: 5,
    };
    
    axios({
      method: "post",
      headers: {
        "Content-Type": "application/json",
      },
      url: url,
      data: bodyFormData,
    })
      .then((response) => console.log(response.data))
      .catch((err) => console.log(err.response ? error.response.data : err));
    
    

    Seitdem bekomme ich folgende fehlermeldung.
    Ich habe zwar schon im Internet geschaut aber ich bin bischer leider erfolglos.

     {'message':'unable to verify the first certificate','name':'Error','stack':'Error: unable to verify the first certificate\n at Function.AxiosError.from (/opt/iobroker/node_modules/iobroker.javascript/node_modules/axios/dist/node/axios.cjs:837:14)\n at RedirectableRequest.handleRequestError (/opt/iobroker/node_modules/iobroker.javascript/node_modules/axios/dist/node/axios.cjs:3016:25)\n at RedirectableRequest.emit (node:events:514:28)\n at ClientRequest.eventHandlers.<computed> (/opt/iobroker/node_modules/follow-redirects/index.js:14:24)\n at ClientRequest.emit (node:events:514:28)\n at TLSSocket.socketErrorListener (node:_http_client:501:9)\n at TLSSocket.emit (node:events:514:28)\n at emitErrorNT (node:internal/streams/destroy:151:8)\n at emitErrorCloseNT (node:internal/streams/destroy:116:3)\n at processTicksAndRejections (node:internal/process/task_queues:82:21)\n','config':{'transitional':{'silentJSONParsing':true,'forcedJSONParsing':true,'clarifyTimeoutError':false},'adapter':'http','transformRequest':[null],'transformResponse':[null],'timeout':0,'xsrfCookieName':'XSRF-TOKEN','xsrfHeaderName':'X-XSRF-TOKEN','maxContentLength':-1,'maxBodyLength':-1,'env':{},'headers':{'Accept':'application/json, text/plain, */*','Content-Type':'application/json','User-Agent':'axios/1.5.0','Content-Length':'89','Accept-Encoding':'gzip, compress, deflate, br'},'method':'post','url':'https://192.168.178.xxx/message?token=ATvOgRNF8QqwGVN','data':'{\'title\':\'Hello from Javascript\',\'message\':\'Test Push Service from Node.js\',\'priority\':5}'},'code':'UNABLE_TO_VERIFY_LEAF_SIGNATURE','status':null}
    

    Hat einer eine idee wie ich das SSL im Code ausschalten kann oder noch besser wie ich dass mit einem Zertifikat hinbekomme also Zertifikat habe ich ja ich weiß nur nicht wie ich dass coden soll.

    B 1 Reply Last reply
    0
    • B BenjaminCz

      Hallo,
      ich habe den Selv Hostet Gotify benachrichtigungs Server der läuft erfolgreich auf HTTPS.

      Vorher hatte ich Gotify als HTTP am laufen und folgenden Code im Java Script dass hatte auch funktioniert.

      const axios = require("axios");
      
      const url = "http://192.168.178.xxx/message?token=ATvOgRNF8QqwGVN";
      const bodyFormData = {
        title: "Hello from Javascript",
        message: "Test Push Service from Node.js",
        priority: 5,
      };
      
      axios({
        method: "post",
        headers: {
          "Content-Type": "application/json",
        },
        url: url,
        data: bodyFormData,
      })
        .then((response) => console.log(response.data))
        .catch((err) => console.log(err.response ? error.response.data : err));
      

      Seit der Umstellung auf HTTPS habe ich den Code so angepasst: (nur HTTP zu HTTPS geändert)

      const axios = require("axios");
      
      const url = "https://192.168.178.xxx/message?token=ATvOgRNF8QqwGVN";
      const bodyFormData = {
        title: "Hello from Javascript",
        message: "Test Push Service from Node.js",
        priority: 5,
      };
      
      axios({
        method: "post",
        headers: {
          "Content-Type": "application/json",
        },
        url: url,
        data: bodyFormData,
      })
        .then((response) => console.log(response.data))
        .catch((err) => console.log(err.response ? error.response.data : err));
      
      

      Seitdem bekomme ich folgende fehlermeldung.
      Ich habe zwar schon im Internet geschaut aber ich bin bischer leider erfolglos.

       {'message':'unable to verify the first certificate','name':'Error','stack':'Error: unable to verify the first certificate\n at Function.AxiosError.from (/opt/iobroker/node_modules/iobroker.javascript/node_modules/axios/dist/node/axios.cjs:837:14)\n at RedirectableRequest.handleRequestError (/opt/iobroker/node_modules/iobroker.javascript/node_modules/axios/dist/node/axios.cjs:3016:25)\n at RedirectableRequest.emit (node:events:514:28)\n at ClientRequest.eventHandlers.<computed> (/opt/iobroker/node_modules/follow-redirects/index.js:14:24)\n at ClientRequest.emit (node:events:514:28)\n at TLSSocket.socketErrorListener (node:_http_client:501:9)\n at TLSSocket.emit (node:events:514:28)\n at emitErrorNT (node:internal/streams/destroy:151:8)\n at emitErrorCloseNT (node:internal/streams/destroy:116:3)\n at processTicksAndRejections (node:internal/process/task_queues:82:21)\n','config':{'transitional':{'silentJSONParsing':true,'forcedJSONParsing':true,'clarifyTimeoutError':false},'adapter':'http','transformRequest':[null],'transformResponse':[null],'timeout':0,'xsrfCookieName':'XSRF-TOKEN','xsrfHeaderName':'X-XSRF-TOKEN','maxContentLength':-1,'maxBodyLength':-1,'env':{},'headers':{'Accept':'application/json, text/plain, */*','Content-Type':'application/json','User-Agent':'axios/1.5.0','Content-Length':'89','Accept-Encoding':'gzip, compress, deflate, br'},'method':'post','url':'https://192.168.178.xxx/message?token=ATvOgRNF8QqwGVN','data':'{\'title\':\'Hello from Javascript\',\'message\':\'Test Push Service from Node.js\',\'priority\':5}'},'code':'UNABLE_TO_VERIFY_LEAF_SIGNATURE','status':null}
      

      Hat einer eine idee wie ich das SSL im Code ausschalten kann oder noch besser wie ich dass mit einem Zertifikat hinbekomme also Zertifikat habe ich ja ich weiß nur nicht wie ich dass coden soll.

      B Offline
      B Offline
      BenjaminCz
      wrote on last edited by BenjaminCz
      #2

      @benjamincz sagte in Gotify "const axios" unable to verify the first certificate:

      Hallo,
      ich habe den Selv Hostet Gotify benachrichtigungs Server der läuft erfolgreich auf HTTPS.

      Vorher hatte ich Gotify als HTTP am laufen und folgenden Code im Java Script dass hatte auch funktioniert.

      const axios = require("axios");
      
      const url = "http://192.168.178.xxx/message?token=ATvOgRNF8QqwGVN";
      const bodyFormData = {
        title: "Hello from Javascript",
        message: "Test Push Service from Node.js",
        priority: 5,
      };
      
      axios({
        method: "post",
        headers: {
          "Content-Type": "application/json",
        },
        url: url,
        data: bodyFormData,
      })
        .then((response) => console.log(response.data))
        .catch((err) => console.log(err.response ? error.response.data : err));
      

      Seit der Umstellung auf HTTPS habe ich den Code so angepasst: (nur HTTP zu HTTPS geändert)

      const axios = require("axios");
      
      const url = "https://192.168.178.xxx/message?token=ATvOgRNF8QqwGVN";
      const bodyFormData = {
        title: "Hello from Javascript",
        message: "Test Push Service from Node.js",
        priority: 5,
      };
      
      axios({
        method: "post",
        headers: {
          "Content-Type": "application/json",
        },
        url: url,
        data: bodyFormData,
      })
        .then((response) => console.log(response.data))
        .catch((err) => console.log(err.response ? error.response.data : err));
      
      

      Seitdem bekomme ich folgende fehlermeldung.
      Ich habe zwar schon im Internet geschaut aber ich bin bischer leider erfolglos.

       {'message':'unable to verify the first certificate','name':'Error','stack':'Error: unable to verify the first certificate\n at Function.AxiosError.from (/opt/iobroker/node_modules/iobroker.javascript/node_modules/axios/dist/node/axios.cjs:837:14)\n at RedirectableRequest.handleRequestError (/opt/iobroker/node_modules/iobroker.javascript/node_modules/axios/dist/node/axios.cjs:3016:25)\n at RedirectableRequest.emit (node:events:514:28)\n at ClientRequest.eventHandlers.<computed> (/opt/iobroker/node_modules/follow-redirects/index.js:14:24)\n at ClientRequest.emit (node:events:514:28)\n at TLSSocket.socketErrorListener (node:_http_client:501:9)\n at TLSSocket.emit (node:events:514:28)\n at emitErrorNT (node:internal/streams/destroy:151:8)\n at emitErrorCloseNT (node:internal/streams/destroy:116:3)\n at processTicksAndRejections (node:internal/process/task_queues:82:21)\n','config':{'transitional':{'silentJSONParsing':true,'forcedJSONParsing':true,'clarifyTimeoutError':false},'adapter':'http','transformRequest':[null],'transformResponse':[null],'timeout':0,'xsrfCookieName':'XSRF-TOKEN','xsrfHeaderName':'X-XSRF-TOKEN','maxContentLength':-1,'maxBodyLength':-1,'env':{},'headers':{'Accept':'application/json, text/plain, */*','Content-Type':'application/json','User-Agent':'axios/1.5.0','Content-Length':'89','Accept-Encoding':'gzip, compress, deflate, br'},'method':'post','url':'https://192.168.178.xxx/message?token=ATvOgRNF8QqwGVN','data':'{\'title\':\'Hello from Javascript\',\'message\':\'Test Push Service from Node.js\',\'priority\':5}'},'code':'UNABLE_TO_VERIFY_LEAF_SIGNATURE','status':null}
      

      Hat einer eine idee wie ich das SSL im Code ausschalten kann oder noch besser wie ich dass mit einem Zertifikat hinbekomme also Zertifikat habe ich ja ich weiß nur nicht wie ich dass coden soll.

      Bin Hier fündig geworden aber leider weiß ich nicht wie in das coden soll:
      Link Text

      T 1 Reply Last reply
      0
      • B BenjaminCz

        @benjamincz sagte in Gotify "const axios" unable to verify the first certificate:

        Hallo,
        ich habe den Selv Hostet Gotify benachrichtigungs Server der läuft erfolgreich auf HTTPS.

        Vorher hatte ich Gotify als HTTP am laufen und folgenden Code im Java Script dass hatte auch funktioniert.

        const axios = require("axios");
        
        const url = "http://192.168.178.xxx/message?token=ATvOgRNF8QqwGVN";
        const bodyFormData = {
          title: "Hello from Javascript",
          message: "Test Push Service from Node.js",
          priority: 5,
        };
        
        axios({
          method: "post",
          headers: {
            "Content-Type": "application/json",
          },
          url: url,
          data: bodyFormData,
        })
          .then((response) => console.log(response.data))
          .catch((err) => console.log(err.response ? error.response.data : err));
        

        Seit der Umstellung auf HTTPS habe ich den Code so angepasst: (nur HTTP zu HTTPS geändert)

        const axios = require("axios");
        
        const url = "https://192.168.178.xxx/message?token=ATvOgRNF8QqwGVN";
        const bodyFormData = {
          title: "Hello from Javascript",
          message: "Test Push Service from Node.js",
          priority: 5,
        };
        
        axios({
          method: "post",
          headers: {
            "Content-Type": "application/json",
          },
          url: url,
          data: bodyFormData,
        })
          .then((response) => console.log(response.data))
          .catch((err) => console.log(err.response ? error.response.data : err));
        
        

        Seitdem bekomme ich folgende fehlermeldung.
        Ich habe zwar schon im Internet geschaut aber ich bin bischer leider erfolglos.

         {'message':'unable to verify the first certificate','name':'Error','stack':'Error: unable to verify the first certificate\n at Function.AxiosError.from (/opt/iobroker/node_modules/iobroker.javascript/node_modules/axios/dist/node/axios.cjs:837:14)\n at RedirectableRequest.handleRequestError (/opt/iobroker/node_modules/iobroker.javascript/node_modules/axios/dist/node/axios.cjs:3016:25)\n at RedirectableRequest.emit (node:events:514:28)\n at ClientRequest.eventHandlers.<computed> (/opt/iobroker/node_modules/follow-redirects/index.js:14:24)\n at ClientRequest.emit (node:events:514:28)\n at TLSSocket.socketErrorListener (node:_http_client:501:9)\n at TLSSocket.emit (node:events:514:28)\n at emitErrorNT (node:internal/streams/destroy:151:8)\n at emitErrorCloseNT (node:internal/streams/destroy:116:3)\n at processTicksAndRejections (node:internal/process/task_queues:82:21)\n','config':{'transitional':{'silentJSONParsing':true,'forcedJSONParsing':true,'clarifyTimeoutError':false},'adapter':'http','transformRequest':[null],'transformResponse':[null],'timeout':0,'xsrfCookieName':'XSRF-TOKEN','xsrfHeaderName':'X-XSRF-TOKEN','maxContentLength':-1,'maxBodyLength':-1,'env':{},'headers':{'Accept':'application/json, text/plain, */*','Content-Type':'application/json','User-Agent':'axios/1.5.0','Content-Length':'89','Accept-Encoding':'gzip, compress, deflate, br'},'method':'post','url':'https://192.168.178.xxx/message?token=ATvOgRNF8QqwGVN','data':'{\'title\':\'Hello from Javascript\',\'message\':\'Test Push Service from Node.js\',\'priority\':5}'},'code':'UNABLE_TO_VERIFY_LEAF_SIGNATURE','status':null}
        

        Hat einer eine idee wie ich das SSL im Code ausschalten kann oder noch besser wie ich dass mit einem Zertifikat hinbekomme also Zertifikat habe ich ja ich weiß nur nicht wie ich dass coden soll.

        Bin Hier fündig geworden aber leider weiß ich nicht wie in das coden soll:
        Link Text

        T Do not disturb
        T Do not disturb
        ticaki
        wrote on last edited by ticaki
        #3

        @benjamincz

        import https from 'https' // oder const https = require('https')
        import axios from 'axios'
        
         const httpsAgent = new https.Agent({
            rejectUnauthorized: false,
         })
          axios.defaults.httpsAgent = httpsAgent
        
        //hier rest vom Script
        

        So in der Art.
        https muß wohl im Javascript-Adapter in die npm module, kannst aber mal ohne versuchen, wenn dann ein Fehler kommt mit Modul nicht gefunden, muß er rein.

        Weather-Warnings Espresense NSPanel-Lovelace-ui Tagesschau

        Spenden

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        Support us

        ioBroker
        Community Adapters
        Donate

        851

        Online

        32.5k

        Users

        81.7k

        Topics

        1.3m

        Posts
        Community
        Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
        ioBroker Community 2014-2025
        logo
        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Home
        • Recent
        • Tags
        • Unread 0
        • Categories
        • Unreplied
        • Popular
        • GitHub
        • Docu
        • Hilfe