Outils pour utilisateurs

Outils du site


blog

Pb HTTPS - Peer's certificate issuer is not recognized - NSS error -8179

Peer's certificate issuer is not recognized
curl --show-error --verbose https://www.acme.fr
* About to connect() to www.acme.fr port 443 (#0)
* Trying 46.18.134.141... connected
* Connected to www.acme.fr (192.168.12.12) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
* Peer's certificate issuer is not recognized: 'CN=GlobalSign Extended Validation CA - SHA256 - G3,O=GlobalSign nv-sa,C=BE'
* NSS error -8179
* Closing connection #0
* Peer certificate cannot be authenticated with known CA certificates
curl: (60) Peer certificate cannot be authenticated with known CA certificates
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn't adequate, you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option 

Solution

yum install ca-certificates
2025/03/24 15:06

Pb hostname FQDN return simple name

La commande hostname -f retourne le nom simple

# hostname -f
srv1

Mais hostnamectl retourne bien le FQDN

# hostnamectl | grep hostname
    Static hostname: srv1.acme.local

Solution

Le FQDN doit être en première position juste après l'IP dans le /etc/hosts

/etc/hosts

127.0.0.1       localhost localhost.localdomain localhost4 localhost4.localdomain4
::1             localhost localhost.localdomain localhost6 localhost6.localdomain6

#192.168.10.10   srv1 srv1.acme.local
192.168.10.10   srv1.acme.local srv1
2025/03/24 15:06

Pb Grub Redhat - err grub2-editenv environment block too small - grubenv

Réparer un fichier grubenv modifié à la main

# grubby --args="transparent_hugepage=never" --update-kernel=ALL
grub2-editenv: error: environment block too small.

Cela arrive si le fichier /boot/grub2/grubenv a été corrompu. Il doit faire exactement 1024 octets.

Solution 1

Voir :

On copie les fichiers avant de les modifier

cp -p /boot/grub2/grubenv /boot/grub2/grubenv.bak
cp -p /boot/grub2/grub.cfg /boot/grub2/grub.cfg.bak
grub2-editenv create

Et si EFI

grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
 
# Et si besoin
#ln -s /boot/efi/EFI/redhat/grubenv /boot/grub2/grubenv

Ou si BIOS

grub2-mkconfig -o /boot/grub2/grub.cfg

Pour SELinux

touch /.autorelabel

Solution 2

On copie le fichier avant de le modifier

cp -p /boot/grub2/grubenv /boot/grub2/grubenv.bak
echo "# GRUB Environment Block" > grubenv.new
grep -v "#" /boot/grub2/grub.cfg.bak >> grubenv.new
$ stat -c "%s" grubenv.new
344

$ echo $((1024 - 344))
680
dd if=<(tr '\000' '#' < /dev/zero) count=1 bs=680 >> grubenv.new
mv grubenv.new /boot/grub2/grubenv

Pour SELinux

touch /.autorelabel

Autres

Recreate file with grub2-editenv create and then set the appropriate saved_entry with grub2-editenv - set saved_entry=

2025/03/24 15:06

Pb failed to find module pci-hotplug acpiphp

after apt-get install

Nov 26 10:22:22 servername systemd-modules-load[22993]: Failed to find module 'pci-hotplug'
Nov 26 10:22:22 servername systemd-modules-load[22993]: Failed to find module 'acpiphp'

Solution

Comment lines

/etc/modules-load.d/modules.conf1

#pci-hotplug
#acpiphp
2025/03/24 15:06

Cloud - Terraform import - OpenTofu import

Importation d'une instance dans le "state"

import.tf

provider "aws" {
  profile    = "default"
  region     = "eu-west-1"
}

resource "aws_instance" "inst1" {
  # (resource arguments)
}
terraform import aws_instance.inst1 i-0127e23e987f1f08a

Création de la définition de notre instance

terraform state list
terraform state show -no-color aws_instance.inst1 > aws_instance-inst1.tf
 
mv import.tf import.tf.bak
 
terraform fmt aws_instance-inst1.tf

Créer ce fichier region.tf

provider "aws" {
access_key = ""
secret_key = ""
region = "eu-west-1"
}
Correction du code
terraform plan -target=aws_instance.inst1 2>&1 | grep Err
Error: "public_ip": this field cannot be set
Error: "arn": this field cannot be set
Error: "public_dns": this field cannot be set
Error: "instance_state": this field cannot be set
Error: "root_block_device.0.volume_id": this field cannot be set
Error: "private_dns": this field cannot be set
Error: "primary_network_interface_id": this field cannot be set
Error: : invalid or unknown key: id

Commenter les ligner en erreur (“public_ip, arn…”)

aws_instance-inst1.tf

# aws_instance.inst1:
resource "aws_instance" "inst1" {
  ami                          = "ami-0a3c5e107eda3e29b"
  #arn                          = "arn:aws:ec2:eu-west-1:299632874688:instance/i-0127e23e987f1f08a"
  associate_public_ip_address  = true
  availability_zone            = "eu-west-1b"
  #cpu_core_count               = 1
  #cpu_threads_per_core         = 1
  disable_api_termination      = false
  ebs_optimized                = false
  get_password_data            = false
  #id                           = "i-0127e23e987f1f08a"
  #instance_state               = "running"
  instance_type                = "t2.micro"
  ipv6_address_count           = 0
  ipv6_addresses               = []
  key_name                     = "My keyPair"
  monitoring                   = false
  #primary_network_interface_id = "eni-034b4bb5957d77123"
  #private_dns                  = "ip-172-31-237-138.eu-west-1.compute.internal"
  private_ip                   = "172.31.237.138"
  #public_dns                   = "ec2-34-241-189-63.eu-west-1.compute.amazonaws.com"
  #public_ip                    = "34.241.189.63"
  security_groups              = []
  source_dest_check            = true
  subnet_id                    = "subnet-0d63fcd2f893bbb9b"
  tags = {
    "Name" = "InstanceName"
  }
  tenancy     = "default"
  volume_tags = {}
  vpc_security_group_ids = [
    "sg-0e09491e039edf3dd",
  ]

  credit_specification {
    cpu_credits = "standard"
  }

#  root_block_device {
#    delete_on_termination = true
#    iops                  = 100
#    volume_id             = "vol-02ccd390ba7b838cd"
#    volume_size           = 8
#    volume_type           = "gp2"
#  }

  timeouts {}
}
#terraform plan -target=aws_instance.inst1
terraform apply
Error: Error launching source instance: UnsupportedOperation: The t2.micro instance type does not support specifying CpuOptions.
        status code: 400, request id: e6bb04ea-3f2a-47d7-a140-98d12857ceed

Commenter les lignes “cpu_core_count” et “cpu_threads_per_core” puis

terraform plan | grep 'known after apply'
#terraform taint aws_instance.inst1
terraform state rm aws_instance.inst1
terraform apply
2025/03/24 15:06
blog.txt · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki