test that keyfile can be None
allow keyfile argument to be None (closes #22787)