### Apache Airflow version

2.3.3 (latest released)

### What happened

I accidentally (and then intentionally) added leading and trailing white spaces while adding connection parameters in Airflow UI Connections form. What followed was an error message that was not so helpful in tracking down the input error by the user.



### What you think should happen instead

Ideally, I expected that there should be a frontend or backend logic that strips off accidental leading or trailing white spaces when adding Connections parameters in Airflow.

### How to reproduce

Intentionally add leading or trailing white spaces while adding Connections parameters.
<img width="981" alt="Screenshot 2022-07-22 at 18 49 54" src="https://user-images.githubusercontent.com/9834450/180497315-0898d803-c104-4d93-b464-c0b33a466b4d.png">



### Operating System

Mac OS

### Versions of Apache Airflow Providers

_No response_

### Deployment

Astronomer

### Deployment details

_No response_

### Anything else

_No response_

### Are you willing to submit PR?

- [X] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)

import json
import operator
from datetime import datetime as dt
from typing import Iterator
import pendulum
from flask_appbuilder.fieldwidgets import (
    BS3PasswordFieldWidget,
    BS3TextAreaFieldWidget,
    BS3TextFieldWidget,
    Select2Widget,
)
from flask_appbuilder.forms import DynamicForm
from flask_babel import lazy_gettext
from flask_wtf import FlaskForm
from wtforms import widgets
from wtforms.fields import Field, IntegerField, PasswordField, SelectField, StringField, TextAreaField
from wtforms.validators import InputRequired, Optional
from airflow.compat.functools import cache
from airflow.configuration import conf
from airflow.providers_manager import ProvidersManager
from airflow.utils import timezone
from airflow.utils.types import DagRunType
from airflow.www.validators import ValidKey
from airflow.www.widgets import (
    AirflowDateTimePickerROWidget,
    AirflowDateTimePickerWidget,
    BS3TextAreaROWidget,
    BS3TextFieldROWidget,
)
class DateTimeWithTimezoneField(Field):