Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

708
Visualizações
Sailsjs Heroku Postgresql Error: self signed certificate

I am new to sails.js and I deployed to heroku and also added a heroku postgreql addon. In my datastore.js file, I added the following configuration so I could migrate my models to the new database addon. Here is a snippet of my datastore.js file.

adapter: "sails-postgresql",
    // URL: my-postgresql-url
    // ssl: true,

In my production.js file here's a snippet of the datastore.

adapter: "sails-postgresql",
      url: process.env.DATABASE_URL,
      ssl: true,

I don't know what seems to be the issue, but this error keeps getting thrown by the server

{                                                                                                      
  error: Error: self signed certificate                                                                
      at TLSSocket.onConnectSecure (_tls_wrap.js:1498:34)                                              
      at TLSSocket.emit (events.js:314:20)                                                             
      at TLSSocket.EventEmitter.emit (domain.js:486:12)                                                
      at TLSSocket._finishInit (_tls_wrap.js:933:8)                                                    
      at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:707:12) {                                           
    code: 'DEPTH_ZERO_SELF_SIGNED_CERT'                                                                
  },                                                                                                   
  meta: {                                                                                              
    adapter: 'sails-postgresql',                                                                       
    url: 'my-postgresql-url',
    ssl: true,                                                                                         
    identity: 'default'                                                                                
  }                                                                                                    
}         

I don't know what exactly to do, any help would be welcome. Thank you.

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

Okay, after reading different articles and googling, to solve the issue, I just had to do this.

ssl: {
 rejectUnauthorized: false
}

and that fixed the issue.

over 4 years ago · Santiago Trujillo Relatório

0

Hit this problem overnight. Some fiddling and identified that there are additional properties needed in the SSL setup:

A working datastore object for Heroku PostgreSQL is as follows:

datastores: {
  default: {
    adapter: 'sails-postgresql',
    url: process.env.DATABASE_URL,
    ssl: {
      sslmode: 'require',
      rejectUnauthorized: false,
    }
  },
},
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda