The main root of both words is a form of finish:
From the etymologies:
early 15c., "limited in space or time, finite," from Latin finitum,
past participle of finire "to limit, set bounds; come to an end" (see
finish (v.)). Related: Finitely; finiteness.
late 14c., "eternal, limitless," also "extremely great in number,"
from Old French infinit "endless, boundless," and directly from Latin
infinitus "unbounded, unlimited," from in- "not, opposite of" (see in-
(1)) + finitus "defining, definite," from finis "end" (see finish
(v.)). The noun meaning "that which is infinite" is from 1580s.
early 15c. (implied in indefinitely), from Latin indefinitus, from in-
"not, opposite of, without" (see in- (1)) + definitus, past participle
of definire (see define).
As you correctly noticed, the key to the distinction is in the prefix de- of definite:
late 14c., "to specify; to end," from Old French defenir, definir "to
finish, conclude, come to an end; bring to an end; define, determine
with precision," and directly from Latin definire "to limit,
determine, explain," from de- "completely" (see de-) + finire "to
bound, limit," from finis "boundary, end" (see finish (v.)). Related:
active word-forming element in English and in many words inherited
from French and Latin, from Latin de "down, down from, from, off;
concerning" (see de), also used as a prefix in Latin usually meaning
"down, off, away, from among, down from," but also "down to the
bottom, totally" hence "completely" (intensive or completive), which
is its sense in many English words. As a Latin prefix it also had the
function of undoing or reversing a verb's action, and hence it came to
be used as a pure privative -- "not, do the opposite of, undo" --
which is its primary function as a living prefix in English, as in
defrost (1895), defuse (1943), etc.
Infinite means without boundaries: going on forever, while indefinite is related meaning without established boundaries. When something is definite, a person has "gotten down to the bottom" of its boundaries, but when something is indefinite, it may be finite, but a person has "not gotten down to the bottom" of where those boundaries actually are.
Infinite space tells us there is no end to the space, but indefinite space simply tells us we don't know the end of the space.