If the prosecution requires the confidential informer (CI) to testify to make their case, yes--though at at least in that circumstance, the judge may allow the source to testify with their identity in some way hidden or disguised. However, the prosecution will generally try NOT to have to rely on CI's, to make sure they remain confidential, and will use other evidence or witnesses if possible. If the defense somehow becomes aware of the CI, they can subpoena the CI to testify--though at that point, the CI is no longer "confidential" anyway.