how can i use my own docker registry in Azure Devops?

Summary

i already added project settings-> service connections-> add docker registry, but when i trying to push my docker image into my own registry, console shows me x509: certificate signed by unknown authority

Service connection configuration

Docker Registry https://xxx.xxx.xx:5000/v2
Docker ID   user
Password    ********

Pipeline configuration

currently i’m using docker template from Azure Devops

trigger:
- master

pool:
  vmImage: 'Ubuntu-16.04'

steps:
- task: [email protected]
  inputs:
    containerRegistry: 'XXXX'
    repository: 'helloworld'
    command: 'buildAndPush'
    Dockerfile: 'Dockerfile'

but i also tried scripts

trigger:
- master

pool:
  vmImage: 'Ubuntu-16.04'

steps:
  - script: docker build -t xxx.xxx.xx:5000/helloworld:latest .
  - script: docker login -u vauman -p JTeS2w276O79 xxx.xxx.xx:5000
  - script: docker push xxx.xxx.xx:5000/helloworld:latest

both not works too

Console output

this is actual console result while i’m using docker template, i’m confused why there’s :3 on the tail of my repository name

Successfully built 6a29968xxxfb
Successfully tagged xxx.xxx.xx:5000/helloworld:3
[command]/usr/bin/docker push xxx.xxx.xx:5000/helloworld:3
The push refers to repository [xxx.xxx.xx:5000/helloworld]
Get ***: x509: certificate signed by unknown authority
##[error]Get ***: x509: certificate signed by unknown authority
##[error]/usr/bin/docker failed with return code: 1

Source: StackOverflow