Quarkus reactive datasource SSL handshake failure - configuration

I am facing the same problem described in (Error on Quarkus reactive datasource SSL handshake). The problem seems solved, but I didn't manage to make it work. I tried providing the trust-certificate-pem property but I still get - Ssl handshake failed.
My yml config looks something like:
quarkus:
datasource:
reactive:
url: postgresql://<host>:5432/<database>
postgresql:
ssl-mode: verify_ca
trust-certificate-pem:
enabled: true
certs: /path/client-cert.pem,/path/server-ca.pem
key-certificate-pem:
enabled: true
keys: /path/client-key.pem
certs: /path/client-cert.pem
Am I missing something? I would really appreciate the help.

Related

Error TypeOrmModule Unable to connect to database with "ETIMEDOUT" or "Handshake inactivity timeout"

I have a NestJS (v8.2.x) server application which I'm attempting to connect to an AWS Arura 3.x (MySQL 8.x protocol) using TypeORM (v0.2.41) and either the mysql (v2.18.1) or mysql2 (v2.3.3) driver. The application is running in a GitHub Codespace.
When following the NestJS TypeORM documentation I'm getting the following errors:
With mysql2 driver I'm getting:
ERROR [TypeOrmModule] Unable to connect to the database. Retrying (1)...
Error: connect ETIMEDOUT
...
With mysql driver I'm getting:
[TypeOrmModule] Error: Handshake inactivity timeout
...
The code creating the connection looks as follows:
import { Module } from '#nestjs/common';
import { TypeOrmModule } from '#nestjs/typeorm';
import { AppController } from './app.controller';
import { AppService } from './app.service';
const MYSQL_HOST = '....rds.amazonaws.com';
const MYSQL_USERNAME = '...';
const MYSQL_PASSWORD = '...';
#Module({
imports: [
TypeOrmModule.forRoot({
type: 'mysql',
host: MYSQL_HOST,
port: 3306,
username: MYSQL_USERNAME,
password: MYSQL_PASSWORD,
database: 'kitchen',
// entities: [__dirname + '/**/*.entity{.ts,.js}'],
debug: true,
logging: true,
}),
],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}
Initial Troubleshooting
First, I validated the credentials I'm utilizing in the server application. I affirmed they worked correctly to connect via TablePlus. Thus, I ruled out "invalid credentials" and determined I had another issue.
Secondly, when creating the AWS Arura database I'd selected Yes to Public Access:
Amazon EC2 instances and devices outside the VPC can connect to your database. Choose one or more VPC security groups that specify which EC2 instances and devices inside the VPC can connect to the database.
Fix
TL;DR: Although, I'd selected Yes to Public Access I had to further relax the "inbound" security rules it seems. Thus, adding another "inbound rule" with source: "0.0.0.0/0" resolved my issue.
Debug
Why? Maybe because the default rule of source: "76.202.164.21/32" doesn't work because of where the GitHub Codespace is hosted? No idea...
How did I find this?
Initially, I was using the mysql2 package and getting it's error (listed above) with no StackOverflow results. As mysql2 is a "drop in replacement" for the basic mysql package I decided to revert to mysql to see if it had a different error. As listed above, I received a slightly different error which lead me to StackOverflow question Error: Handshake inactivity timeout in Node.js MYSQL module. Where there are AWS specific answers:
a) mscheker's add an inbound rule
For those deploying on AWS and experiencing this error, you'll need to make a change to the security group of your database/cluster and add an inbound rule where the source is the security group of your instance/s.
b) Berkay Torun's "changing the allowed IP Addresses"
If you are using Amazon's services, I was able to resolve this by changing the allowed IP Addresses in the security settings or by changing the open connections ports.
are what I followed to resolve the issue. Adding an extra inbound rule of "all IPv4 address" are allowed via source: "0.0.0.0/0".
In my case I had to add the entity in forFeature to the module

GitHub Actions "No profiles for 'com.xxx.app' were found" Despite keychain setup

I am working on a GitHub Actions CI/CD pipeline setup and, after being tested on my computer, I am unable to make it work on Github actions.
The error I am getting is the following:
However, before calling gym I call match:
And before that, on my yaml file I call create_keychain:
Any ideas why the provisioning profile can't be found?
I ended up solving the issue by using the lane keychain_create before calling match
if is_ci
create_keychain(
name: "actions_keychain",
password: "meow",
default_keychain: true,
unlock: true,
timeout: 3600,
lock_when_sleeps: false
)
end

Proxy api server through angular application

I am trying to proxy api server through an Angular 6 application and I get the following error:
UNABLE_TO_GET_ISSUER_CERT_LOCALLY .
How to resolve this?
That's because you're trying to reverse proxy a secure connection, and all secure connection require a certificate to encrypt the connection.
You could either drop the security:
"/example": {
"target": "http://example.com"
"secure": false
}
Or generate the certificates (), and letting devServer (ng serve) know where they are......... which i couldn't find any documentation, about. So I suggest you do as I did and set up a reverse proxy in top of angular to manage this; i prefere nginx but you can use node's proxy-middleware.
By the way, I do think the documentation of the case is lacking, so do all of this people -> https://github.com/angular/angular-cli/pull/1896
Refs
https://github.com/webpack/webpack-dev-server/issues/10

Domain not found: AZF domain not created for application

I got this error while trying to configure level 2 authentication using idm,pep-proxy and pdp.
I am using latest version of authzforce,idm,pep-proxy but this error still persists.
config.azf = {
enabled: true,
protocol: 'http',
host: 'localhost',
port: 8080,
custom_policy: undefined // use undefined to default policy checks (HTTP verb + path).
};
part of config that is relevant.
As I understand idm connected with authzforce should auto create domains, but for some reason that is not case.
I have tried with different versions, read similar issues on stack but problem still persist.Any advice or maybe point what i am doing wrong would be really helpful.
Thanks

Configure JsonProcessingExceptionMapper to log in Dropwizard

I am working on a dropwizard application. I need to configure it to log the exception from JsonProcessingExceptionMapper.
Some of my config.yml file:
server:
type: simple
connector:
type: http
port: 0
requestLog:
appenders: []
registerDefaultExceptionMappers: true
Been looking at JsonProcessingExceptionMapper and it's showDetail property but cannot figure it out. I am using dropwizard version 1.2.3
Found it. I was missing the property detailedJsonProcessingExceptionMapper:
server
registerDefaultExceptionMappers: true
detailedJsonProcessingExceptionMapper: true
Could not find this in the documentation. Could anyone point me to the right place?